Skip to content

Instantly share code, notes, and snippets.

@adamclerk
Created June 10, 2012 15:11
Show Gist options
  • Save adamclerk/2906138 to your computer and use it in GitHub Desktop.
Save adamclerk/2906138 to your computer and use it in GitHub Desktop.
Sample Swagger Resource Files
{
"apiVersion": "0.0.4542.22887",
"swaggerVersion": "1.0",
"basePath": "http://local.api.com/api",
"resourcePath": "/donuts",
"apis": [
{
"path": "/donuts/{page}/{pagesize}",
"description": "Get donuts by page",
"operations": [
{
"httpMethod": "GET",
"notes": "Get a donut with page and size",
"nickname": "getDonutsByPageAndSize",
"summary": "Get a collection of donuts by page and pagesize.",
"parameters": [
{
"name": "page",
"description": "the page of the collection",
"dataType": "int",
"required": true,
"allowMultiple": false,
"paramType": "path"
},
{
"name": "pagesize",
"description": "the size of the collection",
"dataType": "int",
"required": true,
"allowMultiple": false,
"paramType": "path"
}
],
"errorResponses": [ ]
}
]
},
]
}
{
"apiVersion": "0.0.4542.22887",
"swaggerVersion": "1.0",
"basePath": "http://local.api.com/api/doc",
"apis": [
{
"path": "/donuts",
"description": "Operations about donuts"
},
{
"path": "/cakes",
"description": "Operations about cakes"
},
{
"path": "/bagels",
"description": "Operations about bagels"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment