Properly formatting a query parameter for deepObject style #526
Closed
rgates-fieldwire
started this conversation in
General
Replies: 2 comments
-
Way late, but does it work with the properties specified? parameter name: :filters, in: :query, schema: {
type: :object,
style: :deepObject,
explode: true,
properties: {
name_like: { type: :string },
created_at_gte: { type: :string }
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Moving to #582 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've found a couple of similar questions around this topic but none of them seem to answer my questions.
Our API has a filter option that can be passed in as a query parameter:
Example: HOST/api/v3/projects?filters[name_like]=Test&filters[created_at_gte]=2022-04-02 03:55:27.748Z
Looking over Swagger docs, Style: deepObject, Explode: True. Should be the only style that I need
I define the parameter:
parameter name: 'filters', in: :query, schema: { type: :object }, style: :deepObject, explode: true
and then define it:
However I'm getting the following error:
I have set up parameter in the style of name:filters[#{name}] as work around but that is producing a very poor swagger doc on generation.
We are using gem version: rswag-api (2.3.1), rswag-specs (2.4.0)
Beta Was this translation helpful? Give feedback.
All reactions