-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Global/common parameters #341
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
Comments
One problem with that feature is that users may then request a way to 'ignore global parameters' and that's going to complicate things. We've thought about adding it to 2.0 but it was rejected. That said, it does not mean it shouldn't be a proposal for the next version. |
I understand. But maybe it should be explicit that's only non ignorable parameters, API-wide parameters. I will be glad if this can be proposed proposed and discussed for the next version. I agree, there shouldn't be a way to ignore these: it's over-complicated and most of the time it's bad usage of global parameters (if someone have a counter example) I maintain multiple APIs and it's a very common and recurrent use case (with at least the following examples:
Each time, having to repeat them on each operation has the following side-effects:
If some want to ignore a parameter on an operation, it should be seen as "rare exception" and shouldn't prevent the existence of global parameters in the specifications. |
Perhaps if the parameters were linked with a tag, it could apply to all operation objects with the same tag. If the tag was left out, it would be global. |
Parent issue: #560. |
Closing in favor of #633 |
Why is this closed? #633 ( |
Global parameters are common in API definition.
Authentication paramters were made specifics with the
security
property but there is no way to define global common paramters.Most of the time global parameters are business-less parameters and it make sense to define them globally.
I know it's possible to define reusable parameters through the root
parameters
property but it's not the same thing, it does not respond to the need.I have a lot of entry point in the API and I don't want to repeat parameters like
lang
,pretty
orfields
which are global and not functionnaly related to each endpoint.Is there a way I'm not aware to do that like a
globalParameters
property ?If not, is it possible to add that for the next specification release as it's a common use case.
The text was updated successfully, but these errors were encountered: