Skip to content

Instantly share code, notes, and snippets.

@EricWittmann
Created January 25, 2018 13:14
Show Gist options
  • Save EricWittmann/9e56f398ee1ddaa1be93d4df989bdac5 to your computer and use it in GitHub Desktop.
Save EricWittmann/9e56f398ee1ddaa1be93d4df989bdac5 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.0",
"info": {
"title": "Simple OAI 3.0.0 API",
"description": "A simple API using OpenAPI 3.0.0.",
"contact": {
"name": "Example Org",
"url": "http://www.example.org",
"email": "contact@example.org"
},
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0"
},
"version": "2.0.11"
},
"paths": {
"/": {
"get": {
"summary": "List API versions",
"operationId": "listVersionsv2",
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"examples": {
"foo": {
"value": {
"versions": [
{
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
"id": "v2.0",
"links": [
{
"href": "http://127.0.0.1:8774/v2/",
"rel": "self"
}
]
},
{
"status": "EXPERIMENTAL",
"updated": "2013-07-23T11:33:21Z",
"id": "v3.0",
"links": [
{
"href": "http://127.0.0.1:8774/v3/",
"rel": "self"
}
]
}
]
}
}
}
}
}
},
"300": {
"description": "300 response",
"content": {
"application/json": {
"examples": {
"foo": {
"value": "{\n \"versions\": [\n {\n \"status\": \"CURRENT\",\n \"updated\": \"2011-01-21T11:33:21Z\",\n \"id\": \"v2.0\",\n \"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v2/\",\n \"rel\": \"self\"\n
}\n ]\n },\n {\n \"status\": \"EXPERIMENTAL\",\n \"updated\": \"2013-07-23T11:33:21Z\",\n \"id\": \"v3.0\",\n
\"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v3/\",\n \"rel\": \"self\"\n }\n
]\n }\n ]\n}\n"
}
}
}
}
}
}
}
},
"/v2": {
"get": {
"summary": "Show API version details",
"operationId": "getVersionDetailsv2",
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"examples": {
"foo": {
"value": {
"version": {
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
"media-types": [
{
"base": "application/xml",
"type": "application/vnd.openstack.compute+xml;version=2"
},
{
"base": "application/json",
"type": "application/vnd.openstack.compute+json;version=2"
}
],
"id": "v2.0",
"links": [
{
"href": "http://127.0.0.1:8774/v2/",
"rel": "self"
},
{
"href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
"type": "application/pdf",
"rel": "describedby"
},
{
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
"type": "application/vnd.sun.wadl+xml",
"rel": "describedby"
},
{
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
"type": "application/vnd.sun.wadl+xml",
"rel": "describedby"
}
]
}
}
}
}
}
}
},
"203": {
"description": "203 response",
"content": {
"application/json": {
"examples": {
"foo": {
"value": {
"version": {
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
"media-types": [
{
"base": "application/xml",
"type": "application/vnd.openstack.compute+xml;version=2"
},
{
"base": "application/json",
"type": "application/vnd.openstack.compute+json;version=2"
}
],
"id": "v2.0",
"links": [
{
"href": "http://23.253.228.211:8774/v2/",
"rel": "self"
},
{
"href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
"type": "application/pdf",
"rel": "describedby"
},
{
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
"type": "application/vnd.sun.wadl+xml",
"rel": "describedby"
}
]
}
}
}
}
}
}
}
}
},
"put": {
"summary": "Update API version details",
"responses": {
"200": {}
},
"requestBody": {
"description": "A description of the request body goes here.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/User"
}
}
},
"required": true
}
}
}
},
"components": {
"schemas": {
"Address": {
"properties": {
"name": {},
"street": {},
"city": {},
"state": {},
"zip": {}
}
},
"User": {
"properties": {
"address": {
"$ref": "#/components/schemas/Address"
}
}
}
},
"securitySchemes": {
"Basic": {
"type": "http",
"description": "Basic auth.",
"scheme": "Basic"
},
"Implicit OAuth": {
"type": "oauth2",
"description": "Implicit oauth 2.0 auth.",
"flows": {
"implicit": {
"authorizationUrl": "urn:auth:implicit",
"refreshUrl": "urn:refresh:implicit",
"scopes": {
"implicit": "implicit scope"
}
}
}
},
"Password OAuth": {
"type": "oauth2",
"description": "Password oauth 2.0 auth.",
"flows": {
"password": {
"tokenUrl": "urn:token:password",
"refreshUrl": "urn:token:refresh",
"scopes": {
"scope1": "Description 1.",
"scope2": "Description 2."
}
}
}
},
"Multi-OAuth": {
"type": "oauth2",
"description": "Multiple OAuth flows.",
"flows": {
"clientCredentials": {
"tokenUrl": "urn:token:client",
"refreshUrl": "urn:refresh:client",
"scopes": {
"client": "Client scope."
}
},
"authorizationCode": {
"authorizationUrl": "urn:auth:auth",
"tokenUrl": "urn:token:auth",
"refreshUrl": "urn:refresh:auth",
"scopes": {}
}
}
}
}
},
"tags": [
{
"name": "foo",
"description": "The Foo tag."
},
{
"name": "bar",
"description": "The bar tag."
},
{
"name": "baz",
"description": "The baz tag.\n"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment