Skip to content

Instantly share code, notes, and snippets.

@dilipkrish
Created December 15, 2014 23:41
Show Gist options
  • Select an option

  • Save dilipkrish/57f15967dffa29a4ee8c to your computer and use it in GitHub Desktop.

Select an option

Save dilipkrish/57f15967dffa29a4ee8c to your computer and use it in GitHub Desktop.
Rendering parameter types
{
"path":"/businesses/byTypes",
"description":"businessesByCategories",
"operations":[
{
"method":"GET",
"summary":"businessesByCategories",
"notes":"businessesByCategories",
"type":"array",
"items":{
"$ref":"Business"
},
"nickname":"businessesByCategories",
"produces":[
"application/json"
],
"consumes":[
"application/json"
],
"authorizations":{
"oauth2":[
{
"scope":"global",
"description":"accessEverything"
}
]
},
"parameters":[
{
"name":"types",
"description":"types",
"defaultValue":"",
"required":true,
"type":"array",
"items":{
"type":"string"
},
"paramType":"query",
"allowMultiple":true,
"enum":[
"PRODUCT",
"SERVICE"
]
}
],
"responseMessages":[
{
"code":200,
"message":null,
"responseModel":"List"
}
],
"deprecated":"false"
}
]
}
//Do something like this
{
"path":"/businesses/byTypes",
"description":"businessesByCategories",
"operations":[
{
"method":"GET",
"summary":"businessesByCategories",
"notes":"businessesByCategories",
"type":"array",
"items":{
"$ref":"Business"
},
"nickname":"businessesByCategories",
"produces":[
"application/json"
],
"consumes":[
"application/json"
],
"authorizations":{
"oauth2":[
{
"scope":"global",
"description":"accessEverything"
}
]
},
"parameters":[
{
"name":"types",
"description":"types",
"defaultValue":"",
"required":true,
"type":"ArrayOfString", //<-- Defined in the model section
"paramType":"query",
"allowMultiple":true,
"enum":[
"PRODUCT",
"SERVICE"
]
}
],
"responseMessages":[
{
"code":200,
"message":null,
"responseModel":"List"
}
],
"deprecated":"false"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment