Skip to content

Commit

Permalink
feat: addition of a heap of new examples (#7)
Browse files Browse the repository at this point in the history
* feat: adding a slew of new example specs

* chore: reformatting the swagger specs

* chore: reformatting specs so they're consistent

* chore: removing some readme-specific things
  • Loading branch information
erunion authored Jan 28, 2022
1 parent ad7633b commit 7246880
Show file tree
Hide file tree
Showing 41 changed files with 9,214 additions and 1,786 deletions.
22 changes: 8 additions & 14 deletions 2.0/json/api-with-examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@
"title": "Simple API overview",
"version": "v2"
},
"consumes": ["application/json"],
"paths": {
"/": {
"get": {
"operationId": "listVersionsv2",
"summary": "List API versions",
"produces": [
"application/json"
],
"produces": ["application/json"],
"responses": {
"200": {
"description": "200 300 response",
"description": "200 response",
"examples": {
"application/json": "{\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}"
}
},
"300": {
"description": "200 300 response",
"description": "300 response",
"examples": {
"application/json": "{\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}"
}
Expand All @@ -32,27 +31,22 @@
"get": {
"operationId": "getVersionDetailsv2",
"summary": "Show API version details",
"produces": [
"application/json"
],
"produces": ["application/json"],
"responses": {
"200": {
"description": "200 203 response",
"description": "200 response",
"examples": {
"application/json": "{\n \"version\": {\n \"status\": \"CURRENT\",\n \"updated\": \"2011-01-21T11:33:21Z\",\n \"media-types\": [\n {\n \"base\": \"application/xml\",\n \"type\": \"application/vnd.openstack.compute+xml;version=2\"\n },\n {\n \"base\": \"application/json\",\n \"type\": \"application/vnd.openstack.compute+json;version=2\"\n }\n ],\n \"id\": \"v2.0\",\n \"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v2/\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf\",\n \"type\": \"application/pdf\",\n \"rel\": \"describedby\"\n },\n {\n \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n \"type\": \"application/vnd.sun.wadl+xml\",\n \"rel\": \"describedby\"\n },\n {\n \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n \"type\": \"application/vnd.sun.wadl+xml\",\n \"rel\": \"describedby\"\n }\n ]\n }\n}"
}
},
"203": {
"description": "200 203 response",
"description": "203 response",
"examples": {
"application/json": "{\n \"version\": {\n \"status\": \"CURRENT\",\n \"updated\": \"2011-01-21T11:33:21Z\",\n \"media-types\": [\n {\n \"base\": \"application/xml\",\n \"type\": \"application/vnd.openstack.compute+xml;version=2\"\n },\n {\n \"base\": \"application/json\",\n \"type\": \"application/vnd.openstack.compute+json;version=2\"\n }\n ],\n \"id\": \"v2.0\",\n \"links\": [\n {\n \"href\": \"http://23.253.228.211:8774/v2/\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf\",\n \"type\": \"application/pdf\",\n \"rel\": \"describedby\"\n },\n {\n \"href\": \"http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl\",\n \"type\": \"application/vnd.sun.wadl+xml\",\n \"rel\": \"describedby\"\n }\n ]\n }\n}"
}
}
}
}
}
},
"consumes": [
"application/json"
]
}
}
25 changes: 6 additions & 19 deletions 2.0/json/petstore-expanded.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@
},
"host": "petstore.swagger.io",
"basePath": "/api",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": ["http"],
"consumes": ["application/json"],
"produces": ["application/json"],
"paths": {
"/pets": {
"get": {
Expand Down Expand Up @@ -164,9 +158,7 @@
"$ref": "#/definitions/NewPet"
},
{
"required": [
"id"
],
"required": ["id"],
"properties": {
"id": {
"type": "integer",
Expand All @@ -178,9 +170,7 @@
},
"NewPet": {
"type": "object",
"required": [
"name"
],
"required": ["name"],
"properties": {
"name": {
"type": "string"
Expand All @@ -192,10 +182,7 @@
},
"Error": {
"type": "object",
"required": [
"code",
"message"
],
"required": ["code", "message"],
"properties": {
"code": {
"type": "integer",
Expand Down
21 changes: 5 additions & 16 deletions 2.0/json/petstore-minimal.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,14 @@
},
"host": "petstore.swagger.io",
"basePath": "/api",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": ["http"],
"consumes": ["application/json"],
"produces": ["application/json"],
"paths": {
"/pets": {
"get": {
"description": "Returns all pets from the system that the user has access to",
"produces": [
"application/json"
],
"produces": ["application/json"],
"responses": {
"200": {
"description": "A list of pets.",
Expand All @@ -47,10 +39,7 @@
"definitions": {
"Pet": {
"type": "object",
"required": [
"id",
"name"
],
"required": ["id", "name"],
"properties": {
"id": {
"type": "integer",
Expand Down
43 changes: 9 additions & 34 deletions 2.0/json/petstore-simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,15 @@
},
"host": "petstore.swagger.io",
"basePath": "/api",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": ["http"],
"consumes": ["application/json"],
"produces": ["application/json"],
"paths": {
"/pets": {
"get": {
"description": "Returns all pets from the system that the user has access to",
"operationId": "findPets",
"produces": [
"application/json",
"application/xml",
"text/xml",
"text/html"
],
"produces": ["application/json", "application/xml", "text/xml", "text/html"],
"parameters": [
{
"name": "tags",
Expand Down Expand Up @@ -76,9 +65,7 @@
"post": {
"description": "Creates a new pet in the store. Duplicates are allowed",
"operationId": "addPet",
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [
{
"name": "pet",
Expand Down Expand Up @@ -110,12 +97,7 @@
"get": {
"description": "Returns a user based on a single ID, if the user does not have access to the pet",
"operationId": "findPetById",
"produces": [
"application/json",
"application/xml",
"text/xml",
"text/html"
],
"produces": ["application/json", "application/xml", "text/xml", "text/html"],
"parameters": [
{
"name": "id",
Expand Down Expand Up @@ -176,9 +158,7 @@
"$ref": "#/definitions/NewPet"
},
{
"required": [
"id"
],
"required": ["id"],
"properties": {
"id": {
"type": "integer",
Expand All @@ -190,9 +170,7 @@
},
"NewPet": {
"type": "object",
"required": [
"name"
],
"required": ["name"],
"properties": {
"name": {
"type": "string"
Expand All @@ -204,10 +182,7 @@
},
"ErrorModel": {
"type": "object",
"required": [
"code",
"message"
],
"required": ["code", "message"],
"properties": {
"code": {
"type": "integer",
Expand Down
43 changes: 9 additions & 34 deletions 2.0/json/petstore-with-external-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,9 @@
},
"host": "petstore.swagger.io",
"basePath": "/api",
"schemes": [
"http"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": ["http"],
"consumes": ["application/json"],
"produces": ["application/json"],
"paths": {
"/pets": {
"get": {
Expand All @@ -39,12 +33,7 @@
"description": "find more info here",
"url": "https://swagger.io/about"
},
"produces": [
"application/json",
"application/xml",
"text/xml",
"text/html"
],
"produces": ["application/json", "application/xml", "text/xml", "text/html"],
"parameters": [
{
"name": "tags",
Expand Down Expand Up @@ -87,9 +76,7 @@
"post": {
"description": "Creates a new pet in the store. Duplicates are allowed",
"operationId": "addPet",
"produces": [
"application/json"
],
"produces": ["application/json"],
"parameters": [
{
"name": "pet",
Expand Down Expand Up @@ -121,12 +108,7 @@
"get": {
"description": "Returns a user based on a single ID, if the user does not have access to the pet",
"operationId": "findPetById",
"produces": [
"application/json",
"application/xml",
"text/xml",
"text/html"
],
"produces": ["application/json", "application/xml", "text/xml", "text/html"],
"parameters": [
{
"name": "id",
Expand Down Expand Up @@ -187,9 +169,7 @@
"$ref": "#/definitions/NewPet"
},
{
"required": [
"id"
],
"required": ["id"],
"properties": {
"id": {
"type": "integer",
Expand All @@ -201,9 +181,7 @@
},
"NewPet": {
"type": "object",
"required": [
"name"
],
"required": ["name"],
"properties": {
"name": {
"type": "string"
Expand All @@ -215,10 +193,7 @@
},
"ErrorModel": {
"type": "object",
"required": [
"code",
"message"
],
"required": ["code", "message"],
"properties": {
"code": {
"type": "integer",
Expand Down
Loading

0 comments on commit 7246880

Please sign in to comment.