You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any particular reason for this behaviour? It is inconsistent with what happens for request bodies, as shown below.
This can make types used in query parameters difficult for clients to work with, since they can't easily be referenced by name, and a type used in different endpoints may generate multiple equivalent type definitions.
(I have looked a little at trying to implement this myself. My approach was to try to make the HasOpenApi (QueryParam' mods sym a :> sub) instance in src/Servant/OpenApi/Internal.hs more like the HasOpenApi (ReqBody' mods cs a :> sub) instance. I got stuck upon realising that declareSchemaRef works with ToSchema, but we only have ToParamSchema. I don't know enough about this library or openapi3 to know what should be done next, or whether there's some fundamental limitation.)
Is there any particular reason for this behaviour? It is inconsistent with what happens for request bodies, as shown below.
This can make types used in query parameters difficult for clients to work with, since they can't easily be referenced by name, and a type used in different endpoints may generate multiple equivalent type definitions.
(I have looked a little at trying to implement this myself. My approach was to try to make the
HasOpenApi (QueryParam' mods sym a :> sub)
instance insrc/Servant/OpenApi/Internal.hs
more like theHasOpenApi (ReqBody' mods cs a :> sub)
instance. I got stuck upon realising thatdeclareSchemaRef
works withToSchema
, but we only haveToParamSchema
. I don't know enough about this library oropenapi3
to know what should be done next, or whether there's some fundamental limitation.)body.json
param.json
The text was updated successfully, but these errors were encountered: