Skip to content

Instantly share code, notes, and snippets.

@jvarness
Created February 28, 2018 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvarness/bf5feeaf95498dd88b1b971c448671b0 to your computer and use it in GitHub Desktop.
Save jvarness/bf5feeaf95498dd88b1b971c448671b0 to your computer and use it in GitHub Desktop.
Schema
{
"swagger": "2.0",
"info": {
"description": "The RESTful endpoints for the Foo Service.",
"version": "1.0.0",
"title": "Foo REST",
"contact": {
"name": "Jake Varness",
"email": "jake.varness@gmail.com"
}
}
"schemes": ["https"],
"paths": {
"/search": {
"get": {
"tags": ["search"],
"summary": "Finds foos matching the search string",
"description": "Searches for foos",
"operationId": "fooSearch",
"produces": ["application/json"],
"parameters": [{
"name": "searchString",
"in": "query",
"description": "The string used to search for foos",
"required": true,
"type": "string"
},
{
"name": "fooType",
"in": "query",
"description": "The type of foo to search for",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "Custom-Required-Header",
"description": "Useful thing for debugging",
"required": true,
"type": "string"
}],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fooId": {
"type": "string"
}
},
"xml": {
"name": "Foo"
}
}
}
},
"400": {
"description": "Invalid search parameters supplied"
},
"404": {
"description": "No foo found matching criteria"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment