Skip to content

Instantly share code, notes, and snippets.

@foundrium
Created August 22, 2012 21:17
Show Gist options
  • Save foundrium/3429473 to your computer and use it in GitHub Desktop.
Save foundrium/3429473 to your computer and use it in GitHub Desktop.
Swagger Specification Example
{
"apiVersion":"0.2",
"swaggerVersion":"1.1-SNAPSHOT",
"basePath":"http://petstore.swagger.wordnik.com/api",
"resourcePath":"/store",
"apis":[
{
"path":"/store.{format}/order/{orderId}",
"description":"Operations about store",
"operations":[
{
"httpMethod":"GET",
"summary":"Find purchase order by ID",
"notes":"For valid response try integer IDs with value <= 5. Anything above 5 or nonintegers will generate API errors",
"responseClass":"Order",
"nickname":"getOrderById",
"parameters":[
{
"name":"orderId",
"description":"ID of pet that needs to be fetched",
"paramType":"path",
"required":true,
"allowMultiple":false,
"dataType":"string"
}
],
"errorResponses":[
{
"code":400,
"reason":"Invalid ID supplied"
},
{
"code":404,
"reason":"Order not found"
}
]
},
{
"httpMethod":"DELETE",
"summary":"Delete purchase order by ID",
"notes":"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
"responseClass":"void",
"nickname":"deleteOrder",
"parameters":[
{
"name":"orderId",
"description":"ID of the order that needs to be deleted",
"paramType":"path",
"required":true,
"allowMultiple":false,
"dataType":"string"
}
],
"errorResponses":[
{
"code":400,
"reason":"Invalid ID supplied"
},
{
"code":404,
"reason":"Order not found"
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment