Skip to content

Document parameter options outside of Schema object #73

@macfanatic

Description

@macfanatic

Attempting to provide more specifications on the parameter object itself, such as style or explode seems impossible right now, as any options provided are nested under the schema object itself.

Is there a way to achieve this? I feel like we would need an additional method parameter to capture this information separately from the schema options itself.

Proposed possibility:

api :index do
  query! :'client_ids[]', Array[Integer], { uniqueItems: true }, style: :form, explode: true
end

Right now using 3 arguments and passing style: :form, explode: true along with the uniqueItems: true just results as those being nested incorrectly:

Generated, incorrect

{
  "name": "client_ids[]",
  "in": "query",
  "required": true,
  "schema": {
    "type": "array",
    "uniqueItems": true,
    "explode": true,
    "style": "form",
    "items": {
      "type": "integer"
    }
  }
}

Desired

{
  "name": "client_ids[]",
  "in": "query",
  "required": true,
  "explode": true,
  "style": "form",
  "schema": {
    "type": "array",
    "uniqueItems": true,
    "items": {
      "type": "integer"
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions