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
{{ message }}
Repository navigation
Ability for multiple query parameters as template #1794
is it possible to declare a set of query parameters which can be re-used in multiple requests?
For example:
paths:/foo/bar/baz:get:parameters:- in: queryname: barbazsummary: This is a dedicated query parameter only for /foo/bar/baz# Shared- in: queryname: foo- in: queryname: bar- in: queryname: baz/qoo/ooq:get:parameters:- in: queryname: qoosummary: This is a dedicated query parameter only for /qoo/ooq# Shared- in: queryname: foo- in: queryname: bar- in: queryname: baz
I am thinking about something like:
paths:/foo/bar/baz:get:parameters:- in: queryname: barbazsummary: This is a dedicated query parameter only for /foo/bar/baz# Shared- in: query$ref: '#/components/parameters/SharedParameters'/qoo/ooq:get:parameters:- in: queryname: qoosummary: This is a dedicated query parameter only for /qoo/ooq# Shared- in: query$ref: '#/components/parameters/SharedParameters'components:parameters:SharedParameters:schema:type: collectionitems: ["foo", "bar", "baz"]foo:name: fooschema:type: stringdescription: foo descriptionsummary: foo summarybar:name: barschema:type: stringdescription: bar descriptionsummary: bar summarybaz:name: bazschema:type: stringdescription: baz descriptionsummary: baz summary
Parameter type collection could be handled as a list of parameters which. But maybe there is another way of sharing query parameters between requests?
You can of course use $refs to parameters at the pathItem level, or in the components/parameters object, individually. What you are suggesting is somewhat similar to the idea of traits, as covered by OAI/Overlay-Specification#38, #756, OAI/Overlay-Specification#34
I tried to come up with a strawman proposal in this gist
Activity
MikeRalphson commentedon Jan 3, 2019
You can of course use
$refs to parameters at thepathItemlevel, or in thecomponents/parametersobject, individually. What you are suggesting is somewhat similar to the idea of traits, as covered by OAI/Overlay-Specification#38, #756, OAI/Overlay-Specification#34I tried to come up with a strawman proposal in this gist
/cc @darrelmiller as we talked about this recently.
boesing commentedon Jan 4, 2019
Yes, that looks quite exactly what I am looking for. 👍