Parameters[edit]
This section describes parameters defined for a path an operation or global. A unique parameter is defined by a combination of a name and location.
- Path parameters are defined under a path and inherited by all operations under that path.
- Operation parameters are defined under an operation
- Global parameters are defined under parameters in the global components section and are referenced elsewhere via $ref.
Example of a global parameter in the source view:
UI-wise, global parameters are always shown when the parameters tab is active:
Add global parameter[edit]
To add a global parameter select the bottom tab Paths, then Global Parameters tab then click the (+) button from the local toolbar at the top right.
A new parameter is added. Give it a name, then following your needs, either add a schema or content. You can delete it using the Delete parameter link from the local top-right toolbar
Add schema to global parameter[edit]
(If a content type is already used with this parameter, then first delete it by clicking the link Delete content from the local top-right toolbar.)
To add a schema to the parameter, click the red link Add schema... as shown above. You'll be prompted with a wizard to either pick an existing schema or create a new one.
You can change the schema or delete it (will be removed only from the parameter) by using the links Change schema and Delete schema from the local top-right toolbar.
Add content type to global parameter[edit]
(If a schema is already used with this parameter, then first delete it by clicking the link Delete schema from the local top-right toolbar.).
To add a content type to the parameter, click the red link Add content... as shown above. Then add a schema to this content.
Add Path Parameter[edit]
Please note that parameters added to a path are automatically inherited by all operations under that path.
To add a parameter to the path, select the path you want to add a parameter to. Select the tab having the name of the path on the right side (right to Global Parameters tab). Then click the + button from the top right toolbar (or select New Parameter from drop-down sub-menu).
A new parameter is added and its input UI shows up. Fill in a name, pick a schema or content type, and edit the rest of the input fields, if needed.
Add Operation Parameter[edit]
To add a parameter to an operation, select the operation you want to add a parameter to. Select the tab having the name of the operation on the right side (right to Global Parameters tab). Then click the + button from the top right toolbar (or select New Parameter from drop-down sub-menu).
A new parameter is added and its input UI shows up. Fill in a name, pick a schema or content type, and edit the rest of the input fields, if needed.
Delete Parameter[edit]
To delete a parameter, click the Delete parameter link from the local menu of the parameter you want to delete.
Change Parameter Schema[edit]
You can edit a parameter schema by clicking the Change schema link from the local menu of the parameter.
Delete Parameter Schema[edit]
You can delete a parameter schema by clicking the Delete schema link from the local menu of the parameter.
Delete Parameter Content Type[edit]
To delete a parameter content type, click the Delete content link from the local menu of the parameter you want to delete.
Swap Parameter Schema With Content Type[edit]
You're using a schema for a parameter and you want to use a content type instead. To do so, first, delete the schema from the parameter by clicking the link Delete schema from the local top-right toolbar.
Then click the link Add content.
Swap Parameter Content Type With Schema[edit]
You're using content for a parameter and you want to use a schema instead. To do so, first, delete the content from the parameter by clicking the link Delete content from the local top-right toolbar.
Then click the link Add schema.