Created
February 3, 2016 05:41
-
-
Save MrTrick/6ed4dc6694ff0864dffc to your computer and use it in GitHub Desktop.
Making a general swagger parameter definition more specific, by adding json-schema information.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
"definitions": { | |
"special_id_csv": { | |
"description": "One or more of a particular kind of id separated by comma \",\"", | |
"type": "string", | |
"pattern": "^...regrexregexregexregexregex...$" | |
}, | |
} | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"parameters": { | |
... | |
"filter[id]": { | |
"name": "filter[id]", | |
"description": "If specified, return only records matching that id or ids. May be one or more valid ids, separated by comma \",\".", | |
"in": "query", | |
"type": "string" | |
}, | |
... | |
} | |
...inside a partcular path/operation/parameters: [ | |
... | |
{ "allOf": [ | |
{"$ref": "#/parameters/filter[id]"}, | |
{"$ref": "otherfile.json#/definitions/special_id_csv"} | |
] }, | |
... | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment