Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Support for common/global parameters #135
My API has several methods which use some common/global parameters (e.g. language and locale settings).
I know apiconfig.json supports the "keyParam" element, which lets the user set an API key across all methods.
I want to know if iodocs supports specifying arbitrary parameters at this top level that will be applied to all method calls. It is kind of error-prone (and a waste of chars) to have to add each of these params to each of the methods.
I tried adding a "parameters" array to apiconfig.json, but it didn't seem to have any effect.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
No, the I/O Docs schema does not currently support global scope parameters. There are a couple of other schemas that come to mind for addressing this:
Alas, common to both is "referencing" ($ref), referring/pointing to uniquely defined elements elsewhere in the schema. Using the global params approach that you describe sounds most similar to 1. above.
I would rather see this living in the "service.json" file (rather than apiconfig.json). What are your thoughts?