Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document parameter options outside of Schema object #73

Open
macfanatic opened this issue Feb 4, 2021 · 2 comments
Open

Document parameter options outside of Schema object #73

macfanatic opened this issue Feb 4, 2021 · 2 comments

Comments

@macfanatic
Copy link

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"
    }
  }
}
@bopm
Copy link
Contributor

bopm commented Aug 16, 2021

Some ideas of how to deal with that can be borrowed here.

@bopm
Copy link
Contributor

bopm commented Aug 17, 2021

I've updated my PR to include your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants