Skip to content

Instantly share code, notes, and snippets.

@BartMassey
Created May 10, 2018 20:28
Show Gist options
  • Save BartMassey/b58a73520d5ca1b66a6486d4fb345fc6 to your computer and use it in GitHub Desktop.
Save BartMassey/b58a73520d5ca1b66a6486d4fb345fc6 to your computer and use it in GitHub Desktop.
Swagger 2.0 complex parameter demo
{
"consumes": [
"application/json"
],
"swagger": "2.0",
"basePath": "/",
"schemes": [
"https"
],
"produces": [
"application/json"
],
"host": "localhost",
"paths": {
"/demo": {
"get": {
"summary": "Demo parameters",
"responses": {
"200": {
"schema": {
"items": {
"format": "int32",
"title": "Demo Item",
"type": "integer",
"description": "Demo item"
},
"maxItems": 1000,
"title": "get_demo_ok",
"type": "array",
"description": "List of demo items"
},
"description": "Demo Swagger 2.0 parameter handling"
}
},
"parameters": [
{
"uniqueItems": true,
"items": {
"minItems": 2,
"uniqueItems": true,
"items": {
"format": "int32",
"type": "integer"
},
"maxItems": 2,
"collectionFormat": "pipes",
"type": "array"
},
"in": "query",
"name": "parameter",
"maxItems": 100,
"type": "array",
"description": "demo parameter"
}],
"operationId": "get_demo",
"description": "Demo Swagger parameter handling"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment