From d4a1b3693417fe3e1487cc6e715270f726ddbd46 Mon Sep 17 00:00:00 2001 From: Bellangelo Date: Sat, 15 Jun 2024 03:13:25 +0300 Subject: [PATCH 1/2] Examples were moved to learn.openapis.org --- examples/v2.0/json/api-with-examples.json | 58 --- examples/v2.0/json/petstore-expanded.json | 210 ---------- examples/v2.0/json/petstore-minimal.json | 68 ---- .../json/petstore-separate/common/Error.json | 16 - .../json/petstore-separate/spec/NewPet.json | 19 - .../v2.0/json/petstore-separate/spec/Pet.json | 19 - .../petstore-separate/spec/parameters.json | 21 - .../json/petstore-separate/spec/swagger.json | 146 ------- examples/v2.0/json/petstore-simple.json | 222 ----------- .../json/petstore-with-external-docs.json | 233 ----------- examples/v2.0/json/petstore.json | 153 -------- examples/v2.0/json/uber.json | 370 ------------------ examples/v2.0/yaml/api-with-examples.yaml | 164 -------- examples/v2.0/yaml/petstore-expanded.yaml | 142 ------- examples/v2.0/yaml/petstore-minimal.yaml | 47 --- .../yaml/petstore-separate/common/Error.yaml | 10 - .../yaml/petstore-separate/spec/NewPet.yaml | 9 - .../v2.0/yaml/petstore-separate/spec/Pet.yaml | 12 - .../petstore-separate/spec/parameters.yaml | 16 - .../yaml/petstore-separate/spec/swagger.yaml | 100 ----- examples/v2.0/yaml/petstore-simple.yaml | 157 -------- .../yaml/petstore-with-external-docs.yaml | 166 -------- examples/v2.0/yaml/petstore.yaml | 103 ----- examples/v2.0/yaml/uber.yaml | 273 ------------- examples/v3.0/api-with-examples.yaml | 167 -------- examples/v3.0/callback-example.yaml | 61 --- examples/v3.0/link-example.yaml | 203 ---------- examples/v3.0/petstore-expanded.yaml | 158 -------- examples/v3.0/petstore.yaml | 111 ------ examples/v3.0/uspto.yaml | 210 ---------- 30 files changed, 3644 deletions(-) delete mode 100644 examples/v2.0/json/api-with-examples.json delete mode 100644 examples/v2.0/json/petstore-expanded.json delete mode 100644 examples/v2.0/json/petstore-minimal.json delete mode 100644 examples/v2.0/json/petstore-separate/common/Error.json delete mode 100644 examples/v2.0/json/petstore-separate/spec/NewPet.json delete mode 100644 examples/v2.0/json/petstore-separate/spec/Pet.json delete mode 100644 examples/v2.0/json/petstore-separate/spec/parameters.json delete mode 100644 examples/v2.0/json/petstore-separate/spec/swagger.json delete mode 100644 examples/v2.0/json/petstore-simple.json delete mode 100644 examples/v2.0/json/petstore-with-external-docs.json delete mode 100644 examples/v2.0/json/petstore.json delete mode 100644 examples/v2.0/json/uber.json delete mode 100644 examples/v2.0/yaml/api-with-examples.yaml delete mode 100644 examples/v2.0/yaml/petstore-expanded.yaml delete mode 100644 examples/v2.0/yaml/petstore-minimal.yaml delete mode 100644 examples/v2.0/yaml/petstore-separate/common/Error.yaml delete mode 100644 examples/v2.0/yaml/petstore-separate/spec/NewPet.yaml delete mode 100644 examples/v2.0/yaml/petstore-separate/spec/Pet.yaml delete mode 100644 examples/v2.0/yaml/petstore-separate/spec/parameters.yaml delete mode 100644 examples/v2.0/yaml/petstore-separate/spec/swagger.yaml delete mode 100644 examples/v2.0/yaml/petstore-simple.yaml delete mode 100644 examples/v2.0/yaml/petstore-with-external-docs.yaml delete mode 100644 examples/v2.0/yaml/petstore.yaml delete mode 100644 examples/v2.0/yaml/uber.yaml delete mode 100644 examples/v3.0/api-with-examples.yaml delete mode 100644 examples/v3.0/callback-example.yaml delete mode 100644 examples/v3.0/link-example.yaml delete mode 100644 examples/v3.0/petstore-expanded.yaml delete mode 100644 examples/v3.0/petstore.yaml delete mode 100644 examples/v3.0/uspto.yaml diff --git a/examples/v2.0/json/api-with-examples.json b/examples/v2.0/json/api-with-examples.json deleted file mode 100644 index e1b371a070..0000000000 --- a/examples/v2.0/json/api-with-examples.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Simple API overview", - "version": "v2" - }, - "paths": { - "/": { - "get": { - "operationId": "listVersionsv2", - "summary": "List API versions", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "200 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}" - } - }, - "300": { - "description": "200 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}" - } - } - } - } - }, - "/v2": { - "get": { - "operationId": "getVersionDetailsv2", - "summary": "Show API version details", - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "200 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://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", - "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" - ] -} \ No newline at end of file diff --git a/examples/v2.0/json/petstore-expanded.json b/examples/v2.0/json/petstore-expanded.json deleted file mode 100644 index d5d8de8126..0000000000 --- a/examples/v2.0/json/petstore-expanded.json +++ /dev/null @@ -1,210 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "1.0.0", - "title": "Swagger Petstore", - "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", - "termsOfService": "http://swagger.io/terms/", - "contact": { - "name": "Swagger API Team", - "email": "apiteam@swagger.io", - "url": "http://swagger.io" - }, - "license": { - "name": "Apache 2.0", - "url": "https://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "host": "petstore.swagger.io", - "basePath": "/api", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/pets": { - "get": { - "description": "Returns all pets from the system that the user has access to\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\n\nSed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\n", - "operationId": "findPets", - "parameters": [ - { - "name": "tags", - "in": "query", - "description": "tags to filter by", - "required": false, - "type": "array", - "collectionFormat": "csv", - "items": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "description": "maximum number of results to return", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "post": { - "description": "Creates a new pet in the store. Duplicates are allowed", - "operationId": "addPet", - "parameters": [ - { - "name": "pet", - "in": "body", - "description": "Pet to add to the store", - "required": true, - "schema": { - "$ref": "#/definitions/NewPet" - } - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/pets/{id}": { - "get": { - "description": "Returns a user based on a single ID, if the user does not have access to the pet", - "operationId": "find pet by id", - "parameters": [ - { - "name": "id", - "in": "path", - "description": "ID of pet to fetch", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "delete": { - "description": "deletes a single pet based on the ID supplied", - "operationId": "deletePet", - "parameters": [ - { - "name": "id", - "in": "path", - "description": "ID of pet to delete", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "pet deleted" - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - } - }, - "definitions": { - "Pet": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/NewPet" - }, - { - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - } - } - } - ] - }, - "NewPet": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - }, - "Error": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - } - } - } - } -} diff --git a/examples/v2.0/json/petstore-minimal.json b/examples/v2.0/json/petstore-minimal.json deleted file mode 100644 index 0c70baed7e..0000000000 --- a/examples/v2.0/json/petstore-minimal.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "1.0.0", - "title": "Swagger Petstore", - "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", - "termsOfService": "http://swagger.io/terms/", - "contact": { - "name": "Swagger API Team" - }, - "license": { - "name": "MIT" - } - }, - "host": "petstore.swagger.io", - "basePath": "/api", - "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" - ], - "responses": { - "200": { - "description": "A list of pets.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - } - } - } - } - }, - "definitions": { - "Pet": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/examples/v2.0/json/petstore-separate/common/Error.json b/examples/v2.0/json/petstore-separate/common/Error.json deleted file mode 100644 index dd0e65a0fa..0000000000 --- a/examples/v2.0/json/petstore-separate/common/Error.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - } - } -} \ No newline at end of file diff --git a/examples/v2.0/json/petstore-separate/spec/NewPet.json b/examples/v2.0/json/petstore-separate/spec/NewPet.json deleted file mode 100644 index 9104f7f68a..0000000000 --- a/examples/v2.0/json/petstore-separate/spec/NewPet.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "object", - "allOf": [ - { - "$ref": "Pet.json" - }, - { - "required": [ - "name" - ], - "properties": { - "description": { - "type": "integer", - "format": "int64" - } - } - } - ] -} \ No newline at end of file diff --git a/examples/v2.0/json/petstore-separate/spec/Pet.json b/examples/v2.0/json/petstore-separate/spec/Pet.json deleted file mode 100644 index c7ee9fbb05..0000000000 --- a/examples/v2.0/json/petstore-separate/spec/Pet.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "tag": { - "type": "string" - } - } -} \ No newline at end of file diff --git a/examples/v2.0/json/petstore-separate/spec/parameters.json b/examples/v2.0/json/petstore-separate/spec/parameters.json deleted file mode 100644 index a7c11b0a0c..0000000000 --- a/examples/v2.0/json/petstore-separate/spec/parameters.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "tagsParam": { - "name": "tags", - "in": "query", - "description": "tags to filter by", - "required": false, - "type": "array", - "collectionFormat": "csv", - "items": { - "type": "string" - } - }, - "limitsParam": { - "name": "limit", - "in": "query", - "description": "maximum number of results to return", - "required": false, - "type": "integer", - "format": "int32" - } -} \ No newline at end of file diff --git a/examples/v2.0/json/petstore-separate/spec/swagger.json b/examples/v2.0/json/petstore-separate/spec/swagger.json deleted file mode 100644 index 7276990020..0000000000 --- a/examples/v2.0/json/petstore-separate/spec/swagger.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "1.0.0", - "title": "Swagger Petstore", - "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", - "termsOfService": "http://swagger.io/terms/", - "contact": { - "name": "Swagger API Team", - "email": "apiteam@swagger.io", - "url": "http://swagger.io" - }, - "license": { - "name": "Apache 2.0", - "url": "https://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "host": "petstore.swagger.io", - "basePath": "/api", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/pets": { - "get": { - "description": "Returns all pets from the system that the user has access to\nNam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.\n\nSed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.\n", - "operationId": "findPets", - "parameters": [ - { - "$ref": "parameters.json#/tagsParam" - }, - { - "$ref": "parameters.json#/limitsParam" - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "type": "array", - "items": { - "$ref": "Pet.json" - } - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "../common/Error.json" - } - } - } - }, - "post": { - "description": "Creates a new pet in the store. Duplicates are allowed", - "operationId": "addPet", - "parameters": [ - { - "name": "pet", - "in": "body", - "description": "Pet to add to the store", - "required": true, - "schema": { - "$ref": "NewPet.json" - } - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "$ref": "Pet.json" - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "../common/Error.json" - } - } - } - } - }, - "/pets/{id}": { - "get": { - "description": "Returns a user based on a single ID, if the user does not have access to the pet", - "operationId": "find pet by id", - "parameters": [ - { - "name": "id", - "in": "path", - "description": "ID of pet to fetch", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "$ref": "Pet.json" - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "../common/Error.json" - } - } - } - }, - "delete": { - "description": "deletes a single pet based on the ID supplied", - "operationId": "deletePet", - "parameters": [ - { - "name": "id", - "in": "path", - "description": "ID of pet to delete", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "pet deleted" - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "../common/Error.json" - } - } - } - } - } - } -} diff --git a/examples/v2.0/json/petstore-simple.json b/examples/v2.0/json/petstore-simple.json deleted file mode 100644 index 306dc90c9c..0000000000 --- a/examples/v2.0/json/petstore-simple.json +++ /dev/null @@ -1,222 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "1.0.0", - "title": "Swagger Petstore", - "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", - "termsOfService": "http://swagger.io/terms/", - "contact": { - "name": "Swagger API Team" - }, - "license": { - "name": "MIT" - } - }, - "host": "petstore.swagger.io", - "basePath": "/api", - "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" - ], - "parameters": [ - { - "name": "tags", - "in": "query", - "description": "tags to filter by", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "csv" - }, - { - "name": "limit", - "in": "query", - "description": "maximum number of results to return", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/ErrorModel" - } - } - } - }, - "post": { - "description": "Creates a new pet in the store. Duplicates are allowed", - "operationId": "addPet", - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "description": "Pet to add to the store", - "required": true, - "schema": { - "$ref": "#/definitions/NewPet" - } - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/ErrorModel" - } - } - } - } - }, - "/pets/{id}": { - "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" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "ID of pet to fetch", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/ErrorModel" - } - } - } - }, - "delete": { - "description": "deletes a single pet based on the ID supplied", - "operationId": "deletePet", - "parameters": [ - { - "name": "id", - "in": "path", - "description": "ID of pet to delete", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "pet deleted" - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/ErrorModel" - } - } - } - } - } - }, - "definitions": { - "Pet": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/NewPet" - }, - { - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - } - } - } - ] - }, - "NewPet": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - }, - "ErrorModel": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/examples/v2.0/json/petstore-with-external-docs.json b/examples/v2.0/json/petstore-with-external-docs.json deleted file mode 100644 index e9d3f7765d..0000000000 --- a/examples/v2.0/json/petstore-with-external-docs.json +++ /dev/null @@ -1,233 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "1.0.0", - "title": "Swagger Petstore", - "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", - "termsOfService": "http://swagger.io/terms/", - "contact": { - "name": "Swagger API Team", - "email": "apiteam@swagger.io", - "url": "http://swagger.io" - }, - "license": { - "name": "Apache 2.0", - "url": "https://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "externalDocs": { - "description": "find more info here", - "url": "https://swagger.io/about" - }, - "host": "petstore.swagger.io", - "basePath": "/api", - "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", - "externalDocs": { - "description": "find more info here", - "url": "https://swagger.io/about" - }, - "produces": [ - "application/json", - "application/xml", - "text/xml", - "text/html" - ], - "parameters": [ - { - "name": "tags", - "in": "query", - "description": "tags to filter by", - "required": false, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "csv" - }, - { - "name": "limit", - "in": "query", - "description": "maximum number of results to return", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/ErrorModel" - } - } - } - }, - "post": { - "description": "Creates a new pet in the store. Duplicates are allowed", - "operationId": "addPet", - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "description": "Pet to add to the store", - "required": true, - "schema": { - "$ref": "#/definitions/NewPet" - } - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/ErrorModel" - } - } - } - } - }, - "/pets/{id}": { - "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" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "ID of pet to fetch", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "200": { - "description": "pet response", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/ErrorModel" - } - } - } - }, - "delete": { - "description": "deletes a single pet based on the ID supplied", - "operationId": "deletePet", - "parameters": [ - { - "name": "id", - "in": "path", - "description": "ID of pet to delete", - "required": true, - "type": "integer", - "format": "int64" - } - ], - "responses": { - "204": { - "description": "pet deleted" - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/ErrorModel" - } - } - } - } - } - }, - "definitions": { - "Pet": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/NewPet" - }, - { - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - } - } - } - ] - }, - "NewPet": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - }, - "ErrorModel": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - } - } - } - } -} diff --git a/examples/v2.0/json/petstore.json b/examples/v2.0/json/petstore.json deleted file mode 100644 index 415eb3f9ae..0000000000 --- a/examples/v2.0/json/petstore.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "1.0.0", - "title": "Swagger Petstore", - "license": { - "name": "MIT" - } - }, - "host": "petstore.swagger.io", - "basePath": "/v1", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/pets": { - "get": { - "summary": "List all pets", - "operationId": "listPets", - "tags": [ - "pets" - ], - "parameters": [ - { - "name": "limit", - "in": "query", - "description": "How many items to return at one time (max 100)", - "required": false, - "type": "integer", - "format": "int32" - } - ], - "responses": { - "200": { - "description": "An paged array of pets", - "headers": { - "x-next": { - "type": "string", - "description": "A link to the next page of responses" - } - }, - "schema": { - "$ref": "#/definitions/Pets" - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "post": { - "summary": "Create a pet", - "operationId": "createPets", - "tags": [ - "pets" - ], - "responses": { - "201": { - "description": "Null response" - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/pets/{petId}": { - "get": { - "summary": "Info for a specific pet", - "operationId": "showPetById", - "tags": [ - "pets" - ], - "parameters": [ - { - "name": "petId", - "in": "path", - "required": true, - "description": "The id of the pet to retrieve", - "type": "string" - } - ], - "responses": { - "200": { - "description": "Expected response to a valid request", - "schema": { - "$ref": "#/definitions/Pets" - } - }, - "default": { - "description": "unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - } - }, - "definitions": { - "Pet": { - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - }, - "Pets": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - }, - "Error": { - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/examples/v2.0/json/uber.json b/examples/v2.0/json/uber.json deleted file mode 100644 index 957782897d..0000000000 --- a/examples/v2.0/json/uber.json +++ /dev/null @@ -1,370 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Uber API", - "description": "Move your app forward with the Uber API", - "version": "1.0.0" - }, - "host": "api.uber.com", - "schemes": [ - "https" - ], - "basePath": "/v1", - "produces": [ - "application/json" - ], - "paths": { - "/products": { - "get": { - "summary": "Product Types", - "description": "The Products endpoint returns information about the Uber products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order.", - "parameters": [ - { - "name": "latitude", - "in": "query", - "description": "Latitude component of location.", - "required": true, - "type": "number", - "format": "double" - }, - { - "name": "longitude", - "in": "query", - "description": "Longitude component of location.", - "required": true, - "type": "number", - "format": "double" - } - ], - "tags": [ - "Products" - ], - "responses": { - "200": { - "description": "An array of products", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Product" - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/estimates/price": { - "get": { - "summary": "Price Estimates", - "description": "The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.

The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.", - "parameters": [ - { - "name": "start_latitude", - "in": "query", - "description": "Latitude component of start location.", - "required": true, - "type": "number", - "format": "double" - }, - { - "name": "start_longitude", - "in": "query", - "description": "Longitude component of start location.", - "required": true, - "type": "number", - "format": "double" - }, - { - "name": "end_latitude", - "in": "query", - "description": "Latitude component of end location.", - "required": true, - "type": "number", - "format": "double" - }, - { - "name": "end_longitude", - "in": "query", - "description": "Longitude component of end location.", - "required": true, - "type": "number", - "format": "double" - } - ], - "tags": [ - "Estimates" - ], - "responses": { - "200": { - "description": "An array of price estimates by product", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/PriceEstimate" - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/estimates/time": { - "get": { - "summary": "Time Estimates", - "description": "The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs.", - "parameters": [ - { - "name": "start_latitude", - "in": "query", - "description": "Latitude component of start location.", - "required": true, - "type": "number", - "format": "double" - }, - { - "name": "start_longitude", - "in": "query", - "description": "Longitude component of start location.", - "required": true, - "type": "number", - "format": "double" - }, - { - "name": "customer_uuid", - "in": "query", - "type": "string", - "format": "uuid", - "description": "Unique customer identifier to be used for experience customization." - }, - { - "name": "product_id", - "in": "query", - "type": "string", - "description": "Unique identifier representing a specific product for a given latitude & longitude." - } - ], - "tags": [ - "Estimates" - ], - "responses": { - "200": { - "description": "An array of products", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Product" - } - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/me": { - "get": { - "summary": "User Profile", - "description": "The User Profile endpoint returns information about the Uber user that has authorized with the application.", - "tags": [ - "User" - ], - "responses": { - "200": { - "description": "Profile information for a user", - "schema": { - "$ref": "#/definitions/Profile" - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/history": { - "get": { - "summary": "User Activity", - "description": "The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.

The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.", - "parameters": [ - { - "name": "offset", - "in": "query", - "type": "integer", - "format": "int32", - "description": "Offset the list of returned results by this amount. Default is zero." - }, - { - "name": "limit", - "in": "query", - "type": "integer", - "format": "int32", - "description": "Number of items to retrieve. Default is 5, maximum is 100." - } - ], - "tags": [ - "User" - ], - "responses": { - "200": { - "description": "History information for the given user", - "schema": { - "$ref": "#/definitions/Activities" - } - }, - "default": { - "description": "Unexpected error", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - } - }, - "definitions": { - "Product": { - "properties": { - "product_id": { - "type": "string", - "description": "Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles." - }, - "description": { - "type": "string", - "description": "Description of product." - }, - "display_name": { - "type": "string", - "description": "Display name of product." - }, - "capacity": { - "type": "string", - "description": "Capacity of product. For example, 4 people." - }, - "image": { - "type": "string", - "description": "Image URL representing the product." - } - } - }, - "PriceEstimate": { - "properties": { - "product_id": { - "type": "string", - "description": "Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles" - }, - "currency_code": { - "type": "string", - "description": "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code." - }, - "display_name": { - "type": "string", - "description": "Display name of product." - }, - "estimate": { - "type": "string", - "description": "Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or \"Metered\" for TAXI." - }, - "low_estimate": { - "type": "number", - "description": "Lower bound of the estimated price." - }, - "high_estimate": { - "type": "number", - "description": "Upper bound of the estimated price." - }, - "surge_multiplier": { - "type": "number", - "description": "Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier." - } - } - }, - "Profile": { - "properties": { - "first_name": { - "type": "string", - "description": "First name of the Uber user." - }, - "last_name": { - "type": "string", - "description": "Last name of the Uber user." - }, - "email": { - "type": "string", - "description": "Email address of the Uber user" - }, - "picture": { - "type": "string", - "description": "Image URL of the Uber user." - }, - "promo_code": { - "type": "string", - "description": "Promo code of the Uber user." - } - } - }, - "Activity": { - "properties": { - "uuid": { - "type": "string", - "description": "Unique identifier for the activity" - } - } - }, - "Activities": { - "properties": { - "offset": { - "type": "integer", - "format": "int32", - "description": "Position in pagination." - }, - "limit": { - "type": "integer", - "format": "int32", - "description": "Number of items to retrieve (100 max)." - }, - "count": { - "type": "integer", - "format": "int32", - "description": "Total number of items available." - }, - "history": { - "type": "array", - "items": { - "$ref": "#/definitions/Activity" - } - } - } - }, - "Error": { - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "fields": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/examples/v2.0/yaml/api-with-examples.yaml b/examples/v2.0/yaml/api-with-examples.yaml deleted file mode 100644 index 2f4a1ccf10..0000000000 --- a/examples/v2.0/yaml/api-with-examples.yaml +++ /dev/null @@ -1,164 +0,0 @@ -swagger: "2.0" -info: - title: Simple API overview - version: v2 -paths: - /: - get: - operationId: listVersionsv2 - summary: List API versions - produces: - - application/json - responses: - "200": - description: |- - 200 300 response - examples: - application/json: |- - { - "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: |- - 200 300 response - examples: - application/json: |- - { - "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" - } - ] - } - ] - } - /v2: - get: - operationId: getVersionDetailsv2 - summary: Show API version details - produces: - - application/json - responses: - "200": - description: |- - 200 203 response - examples: - application/json: |- - { - "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: |- - 200 203 response - examples: - application/json: |- - { - "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" - } - ] - } - } -consumes: -- application/json diff --git a/examples/v2.0/yaml/petstore-expanded.yaml b/examples/v2.0/yaml/petstore-expanded.yaml deleted file mode 100644 index de93377412..0000000000 --- a/examples/v2.0/yaml/petstore-expanded.yaml +++ /dev/null @@ -1,142 +0,0 @@ -swagger: "2.0" -info: - version: 1.0.0 - title: Swagger Petstore - description: A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification - termsOfService: http://swagger.io/terms/ - contact: - name: Swagger API Team - email: apiteam@swagger.io - url: http://swagger.io - license: - name: Apache 2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html -host: petstore.swagger.io -basePath: /api -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 - parameters: - - name: tags - in: query - description: tags to filter by - required: false - type: array - collectionFormat: csv - items: - type: string - - name: limit - in: query - description: maximum number of results to return - required: false - type: integer - format: int32 - responses: - "200": - description: pet response - schema: - type: array - items: - $ref: '#/definitions/Pet' - default: - description: unexpected error - schema: - $ref: '#/definitions/Error' - post: - description: Creates a new pet in the store. Duplicates are allowed - operationId: addPet - parameters: - - name: pet - in: body - description: Pet to add to the store - required: true - schema: - $ref: '#/definitions/NewPet' - responses: - "200": - description: pet response - schema: - $ref: '#/definitions/Pet' - default: - description: unexpected error - schema: - $ref: '#/definitions/Error' - /pets/{id}: - get: - description: Returns a user based on a single ID, if the user does not have access to the pet - operationId: find pet by id - parameters: - - name: id - in: path - description: ID of pet to fetch - required: true - type: integer - format: int64 - responses: - "200": - description: pet response - schema: - $ref: '#/definitions/Pet' - default: - description: unexpected error - schema: - $ref: '#/definitions/Error' - delete: - description: deletes a single pet based on the ID supplied - operationId: deletePet - parameters: - - name: id - in: path - description: ID of pet to delete - required: true - type: integer - format: int64 - responses: - "204": - description: pet deleted - default: - description: unexpected error - schema: - $ref: '#/definitions/Error' -definitions: - Pet: - allOf: - - $ref: '#/definitions/NewPet' - - required: - - id - type: "object" - properties: - id: - type: integer - format: int64 - - NewPet: - type: "object" - required: - - name - properties: - name: - type: string - tag: - type: string - - Error: - type: "object" - required: - - code - - message - properties: - code: - type: integer - format: int32 - message: - type: string diff --git a/examples/v2.0/yaml/petstore-minimal.yaml b/examples/v2.0/yaml/petstore-minimal.yaml deleted file mode 100644 index c3e06e9152..0000000000 --- a/examples/v2.0/yaml/petstore-minimal.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- - swagger: "2.0" - info: - version: "1.0.0" - title: "Swagger Petstore" - description: "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification" - termsOfService: "http://swagger.io/terms/" - contact: - name: "Swagger API Team" - license: - name: "MIT" - host: "petstore.swagger.io" - basePath: "/api" - 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" - responses: - "200": - description: "A list of pets." - schema: - type: "array" - items: - $ref: "#/definitions/Pet" - definitions: - Pet: - type: "object" - required: - - "id" - - "name" - properties: - id: - type: "integer" - format: "int64" - name: - type: "string" - tag: - type: "string" - diff --git a/examples/v2.0/yaml/petstore-separate/common/Error.yaml b/examples/v2.0/yaml/petstore-separate/common/Error.yaml deleted file mode 100644 index 2d87b744fb..0000000000 --- a/examples/v2.0/yaml/petstore-separate/common/Error.yaml +++ /dev/null @@ -1,10 +0,0 @@ -type: object -required: - - code - - message -properties: - code: - type: integer - format: int32 - message: - type: string diff --git a/examples/v2.0/yaml/petstore-separate/spec/NewPet.yaml b/examples/v2.0/yaml/petstore-separate/spec/NewPet.yaml deleted file mode 100644 index 35e67449c5..0000000000 --- a/examples/v2.0/yaml/petstore-separate/spec/NewPet.yaml +++ /dev/null @@ -1,9 +0,0 @@ -type: object -allOf: - - $ref: 'Pet.yaml' - - required: - - name - properties: - description: - type: integer - format: int64 diff --git a/examples/v2.0/yaml/petstore-separate/spec/Pet.yaml b/examples/v2.0/yaml/petstore-separate/spec/Pet.yaml deleted file mode 100644 index bb113196f1..0000000000 --- a/examples/v2.0/yaml/petstore-separate/spec/Pet.yaml +++ /dev/null @@ -1,12 +0,0 @@ -type: object -required: - - id - - name -properties: - id: - type: integer - format: int64 - name: - type: string - tag: - type: string diff --git a/examples/v2.0/yaml/petstore-separate/spec/parameters.yaml b/examples/v2.0/yaml/petstore-separate/spec/parameters.yaml deleted file mode 100644 index 18736aebd0..0000000000 --- a/examples/v2.0/yaml/petstore-separate/spec/parameters.yaml +++ /dev/null @@ -1,16 +0,0 @@ -tagsParam: - name: tags - in: query - description: tags to filter by - required: false - type: array - collectionFormat: csv - items: - type: string -limitsParam: - name: limit - in: query - description: maximum number of results to return - required: false - type: integer - format: int32 diff --git a/examples/v2.0/yaml/petstore-separate/spec/swagger.yaml b/examples/v2.0/yaml/petstore-separate/spec/swagger.yaml deleted file mode 100644 index b937b5022a..0000000000 --- a/examples/v2.0/yaml/petstore-separate/spec/swagger.yaml +++ /dev/null @@ -1,100 +0,0 @@ -swagger: "2.0" -info: - version: 1.0.0 - title: Swagger Petstore - description: A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification - termsOfService: http://swagger.io/terms/ - contact: - name: Swagger API Team - email: apiteam@swagger.io - url: http://swagger.io - license: - name: Apache 2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html -host: petstore.swagger.io -basePath: /api -schemes: - - http -consumes: - - application/json -produces: - - application/json -paths: - /pets: - get: - description: | - Returns all pets from the system that the user has access to - Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. - - Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. - operationId: findPets - parameters: - - $ref: 'parameters.yaml#/tagsParam' - - $ref: 'parameters.yaml#/limitsParam' - responses: - "200": - description: pet response - schema: - type: array - items: - $ref: 'Pet.yaml' - default: - description: unexpected error - schema: - $ref: '../common/Error.yaml' - post: - description: Creates a new pet in the store. Duplicates are allowed - operationId: addPet - parameters: - - name: pet - in: body - description: Pet to add to the store - required: true - schema: - $ref: 'NewPet.yaml' - responses: - "200": - description: pet response - schema: - $ref: 'Pet.yaml' - default: - description: unexpected error - schema: - $ref: '../common/Error.yaml' - /pets/{id}: - get: - description: Returns a user based on a single ID, if the user does not have access to the pet - operationId: find pet by id - parameters: - - name: id - in: path - description: ID of pet to fetch - required: true - type: integer - format: int64 - responses: - "200": - description: pet response - schema: - $ref: 'Pet.yaml' - default: - description: unexpected error - schema: - $ref: '../common/Error.yaml' - delete: - description: deletes a single pet based on the ID supplied - operationId: deletePet - parameters: - - name: id - in: path - description: ID of pet to delete - required: true - type: integer - format: int64 - responses: - "204": - description: pet deleted - default: - description: unexpected error - schema: - $ref: '../common/Error.yaml' diff --git a/examples/v2.0/yaml/petstore-simple.yaml b/examples/v2.0/yaml/petstore-simple.yaml deleted file mode 100644 index d5fa07b428..0000000000 --- a/examples/v2.0/yaml/petstore-simple.yaml +++ /dev/null @@ -1,157 +0,0 @@ ---- - swagger: "2.0" - info: - version: "1.0.0" - title: "Swagger Petstore" - description: "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification" - termsOfService: "http://swagger.io/terms/" - contact: - name: "Swagger API Team" - license: - name: "MIT" - host: "petstore.swagger.io" - basePath: "/api" - 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" - parameters: - - - name: "tags" - in: "query" - description: "tags to filter by" - required: false - type: "array" - items: - type: "string" - collectionFormat: "csv" - - - name: "limit" - in: "query" - description: "maximum number of results to return" - required: false - type: "integer" - format: "int32" - responses: - "200": - description: "pet response" - schema: - type: "array" - items: - $ref: "#/definitions/Pet" - default: - description: "unexpected error" - schema: - $ref: "#/definitions/ErrorModel" - post: - description: "Creates a new pet in the store. Duplicates are allowed" - operationId: "addPet" - produces: - - "application/json" - parameters: - - - name: "pet" - in: "body" - description: "Pet to add to the store" - required: true - schema: - $ref: "#/definitions/NewPet" - responses: - "200": - description: "pet response" - schema: - $ref: "#/definitions/Pet" - default: - description: "unexpected error" - schema: - $ref: "#/definitions/ErrorModel" - /pets/{id}: - 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" - parameters: - - - name: "id" - in: "path" - description: "ID of pet to fetch" - required: true - type: "integer" - format: "int64" - responses: - "200": - description: "pet response" - schema: - $ref: "#/definitions/Pet" - default: - description: "unexpected error" - schema: - $ref: "#/definitions/ErrorModel" - delete: - description: "deletes a single pet based on the ID supplied" - operationId: "deletePet" - parameters: - - - name: "id" - in: "path" - description: "ID of pet to delete" - required: true - type: "integer" - format: "int64" - responses: - "204": - description: "pet deleted" - default: - description: "unexpected error" - schema: - $ref: "#/definitions/ErrorModel" - definitions: - Pet: - type: "object" - allOf: - - - $ref: "#/definitions/NewPet" - - - required: - - "id" - properties: - id: - type: "integer" - format: "int64" - NewPet: - type: "object" - required: - - "name" - properties: - name: - type: "string" - tag: - type: "string" - ErrorModel: - type: "object" - required: - - "code" - - "message" - properties: - code: - type: "integer" - format: "int32" - message: - type: "string" - diff --git a/examples/v2.0/yaml/petstore-with-external-docs.yaml b/examples/v2.0/yaml/petstore-with-external-docs.yaml deleted file mode 100644 index 792864fca0..0000000000 --- a/examples/v2.0/yaml/petstore-with-external-docs.yaml +++ /dev/null @@ -1,166 +0,0 @@ ---- - swagger: "2.0" - info: - version: "1.0.0" - title: "Swagger Petstore" - description: "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification" - termsOfService: "http://swagger.io/terms/" - contact: - name: "Swagger API Team" - email: "apiteam@swagger.io" - url: "http://swagger.io" - license: - name: "Apache 2.0" - url: "https://www.apache.org/licenses/LICENSE-2.0.html" - externalDocs: - description: "find more info here" - url: "https://swagger.io/about" - host: "petstore.swagger.io" - basePath: "/api" - 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" - externalDocs: - description: "find more info here" - url: "https://swagger.io/about" - produces: - - "application/json" - - "application/xml" - - "text/xml" - - "text/html" - parameters: - - - name: "tags" - in: "query" - description: "tags to filter by" - required: false - type: "array" - items: - type: "string" - collectionFormat: "csv" - - - name: "limit" - in: "query" - description: "maximum number of results to return" - required: false - type: "integer" - format: "int32" - responses: - "200": - description: "pet response" - schema: - type: "array" - items: - $ref: "#/definitions/Pet" - default: - description: "unexpected error" - schema: - $ref: "#/definitions/ErrorModel" - post: - description: "Creates a new pet in the store. Duplicates are allowed" - operationId: "addPet" - produces: - - "application/json" - parameters: - - - name: "pet" - in: "body" - description: "Pet to add to the store" - required: true - schema: - $ref: "#/definitions/NewPet" - responses: - "200": - description: "pet response" - schema: - $ref: "#/definitions/Pet" - default: - description: "unexpected error" - schema: - $ref: "#/definitions/ErrorModel" - /pets/{id}: - 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" - parameters: - - - name: "id" - in: "path" - description: "ID of pet to fetch" - required: true - type: "integer" - format: "int64" - responses: - "200": - description: "pet response" - schema: - $ref: "#/definitions/Pet" - default: - description: "unexpected error" - schema: - $ref: "#/definitions/ErrorModel" - delete: - description: "deletes a single pet based on the ID supplied" - operationId: "deletePet" - parameters: - - - name: "id" - in: "path" - description: "ID of pet to delete" - required: true - type: "integer" - format: "int64" - responses: - "204": - description: "pet deleted" - default: - description: "unexpected error" - schema: - $ref: "#/definitions/ErrorModel" - definitions: - Pet: - type: "object" - allOf: - - - $ref: "#/definitions/NewPet" - - - required: - - "id" - properties: - id: - type: "integer" - format: "int64" - NewPet: - type: "object" - required: - - "name" - properties: - name: - type: "string" - tag: - type: "string" - ErrorModel: - type: "object" - required: - - "code" - - "message" - properties: - code: - type: "integer" - format: "int32" - message: - type: "string" - diff --git a/examples/v2.0/yaml/petstore.yaml b/examples/v2.0/yaml/petstore.yaml deleted file mode 100644 index 5f41fe091f..0000000000 --- a/examples/v2.0/yaml/petstore.yaml +++ /dev/null @@ -1,103 +0,0 @@ -swagger: "2.0" -info: - version: 1.0.0 - title: Swagger Petstore - license: - name: MIT -host: petstore.swagger.io -basePath: /v1 -schemes: - - http -consumes: - - application/json -produces: - - application/json -paths: - /pets: - get: - summary: List all pets - operationId: listPets - tags: - - pets - parameters: - - name: limit - in: query - description: How many items to return at one time (max 100) - required: false - type: integer - format: int32 - responses: - "200": - description: A paged array of pets - headers: - x-next: - type: string - description: A link to the next page of responses - schema: - $ref: '#/definitions/Pets' - default: - description: unexpected error - schema: - $ref: '#/definitions/Error' - post: - summary: Create a pet - operationId: createPets - tags: - - pets - responses: - "201": - description: Null response - default: - description: unexpected error - schema: - $ref: '#/definitions/Error' - /pets/{petId}: - get: - summary: Info for a specific pet - operationId: showPetById - tags: - - pets - parameters: - - name: petId - in: path - required: true - description: The id of the pet to retrieve - type: string - responses: - "200": - description: Expected response to a valid request - schema: - $ref: '#/definitions/Pets' - default: - description: unexpected error - schema: - $ref: '#/definitions/Error' -definitions: - Pet: - type: "object" - required: - - id - - name - properties: - id: - type: integer - format: int64 - name: - type: string - tag: - type: string - Pets: - type: array - items: - $ref: '#/definitions/Pet' - Error: - type: "object" - required: - - code - - message - properties: - code: - type: integer - format: int32 - message: - type: string diff --git a/examples/v2.0/yaml/uber.yaml b/examples/v2.0/yaml/uber.yaml deleted file mode 100644 index 12c14b08aa..0000000000 --- a/examples/v2.0/yaml/uber.yaml +++ /dev/null @@ -1,273 +0,0 @@ -# this is an example of the Uber API -# as a demonstration of an API spec in YAML -swagger: "2.0" -info: - title: Uber API - description: Move your app forward with the Uber API - version: "1.0.0" -# the domain of the service -host: api.uber.com -# array of all schemes that your API supports -schemes: - - https -# will be prefixed to all paths -basePath: /v1 -securityDefinitions: - apikey: - type: apiKey - name: server_token - in: query -produces: - - application/json -paths: - /products: - get: - summary: Product Types - description: The Products endpoint returns information about the Uber products offered at a given location. The response includes the display name and other details about each product, and lists the products in the proper display order. - parameters: - - name: latitude - in: query - description: Latitude component of location. - required: true - type: number - format: double - - name: longitude - in: query - description: Longitude component of location. - required: true - type: number - format: double - security: - - apikey: [] - tags: - - Products - responses: - "200": - description: An array of products - schema: - type: array - items: - $ref: '#/definitions/Product' - default: - description: Unexpected error - schema: - $ref: '#/definitions/Error' - /estimates/price: - get: - summary: Price Estimates - description: The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.

The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier. - parameters: - - name: start_latitude - in: query - description: Latitude component of start location. - required: true - type: number - format: double - - name: start_longitude - in: query - description: Longitude component of start location. - required: true - type: number - format: double - - name: end_latitude - in: query - description: Latitude component of end location. - required: true - type: number - format: double - - name: end_longitude - in: query - description: Longitude component of end location. - required: true - type: number - format: double - tags: - - Estimates - responses: - "200": - description: An array of price estimates by product - schema: - type: array - items: - $ref: '#/definitions/PriceEstimate' - default: - description: Unexpected error - schema: - $ref: '#/definitions/Error' - /estimates/time: - get: - summary: Time Estimates - description: The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs. - parameters: - - name: start_latitude - in: query - description: Latitude component of start location. - required: true - type: number - format: double - - name: start_longitude - in: query - description: Longitude component of start location. - required: true - type: number - format: double - - name: customer_uuid - in: query - type: string - format: uuid - description: Unique customer identifier to be used for experience customization. - - name: product_id - in: query - type: string - description: Unique identifier representing a specific product for a given latitude & longitude. - tags: - - Estimates - responses: - "200": - description: An array of products - schema: - type: array - items: - $ref: '#/definitions/Product' - default: - description: Unexpected error - schema: - $ref: '#/definitions/Error' - /me: - get: - summary: User Profile - description: The User Profile endpoint returns information about the Uber user that has authorized with the application. - tags: - - User - responses: - "200": - description: Profile information for a user - schema: - $ref: '#/definitions/Profile' - default: - description: Unexpected error - schema: - $ref: '#/definitions/Error' - /history: - get: - summary: User Activity - description: The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.

The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary. - parameters: - - name: offset - in: query - type: integer - format: int32 - description: Offset the list of returned results by this amount. Default is zero. - - name: limit - in: query - type: integer - format: int32 - description: Number of items to retrieve. Default is 5, maximum is 100. - tags: - - User - responses: - "200": - description: History information for the given user - schema: - $ref: '#/definitions/Activities' - default: - description: Unexpected error - schema: - $ref: '#/definitions/Error' -definitions: - Product: - properties: - product_id: - type: string - description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. - description: - type: string - description: Description of product. - display_name: - type: string - description: Display name of product. - capacity: - type: integer - description: Capacity of product. For example, 4 people. - image: - type: string - description: Image URL representing the product. - ProductList: - properties: - products: - description: Contains the list of products - type: array - items: - $ref: "#/definitions/Product" - PriceEstimate: - properties: - product_id: - type: string - description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles - currency_code: - type: string - description: "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code." - display_name: - type: string - description: Display name of product. - estimate: - type: string - description: Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI. - low_estimate: - type: number - description: Lower bound of the estimated price. - high_estimate: - type: number - description: Upper bound of the estimated price. - surge_multiplier: - type: number - description: Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier. - Profile: - properties: - first_name: - type: string - description: First name of the Uber user. - last_name: - type: string - description: Last name of the Uber user. - email: - type: string - description: Email address of the Uber user - picture: - type: string - description: Image URL of the Uber user. - promo_code: - type: string - description: Promo code of the Uber user. - Activity: - properties: - uuid: - type: string - description: Unique identifier for the activity - Activities: - properties: - offset: - type: integer - format: int32 - description: Position in pagination. - limit: - type: integer - format: int32 - description: Number of items to retrieve (100 max). - count: - type: integer - format: int32 - description: Total number of items available. - history: - type: array - items: - $ref: '#/definitions/Activity' - Error: - properties: - code: - type: integer - format: int32 - message: - type: string - fields: - type: string diff --git a/examples/v3.0/api-with-examples.yaml b/examples/v3.0/api-with-examples.yaml deleted file mode 100644 index 09003b6aba..0000000000 --- a/examples/v3.0/api-with-examples.yaml +++ /dev/null @@ -1,167 +0,0 @@ -openapi: "3.0.0" -info: - title: Simple API overview - version: 2.0.0 -paths: - /: - get: - operationId: listVersionsv2 - summary: List API versions - 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: | - { - "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" - } - ] - } - ] - } - /v2: - get: - operationId: getVersionDetailsv2 - summary: Show API version details - 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" - } - ] - } - } diff --git a/examples/v3.0/callback-example.yaml b/examples/v3.0/callback-example.yaml deleted file mode 100644 index 262b8df518..0000000000 --- a/examples/v3.0/callback-example.yaml +++ /dev/null @@ -1,61 +0,0 @@ -openapi: 3.0.0 -info: - title: Callback Example - version: 1.0.0 -paths: - /streams: - post: - description: subscribes a client to receive out-of-band data - parameters: - - name: callbackUrl - in: query - required: true - description: | - the location where data will be sent. Must be network accessible - by the source server - schema: - type: string - format: uri - example: https://tonys-server.com - responses: - '201': - description: subscription successfully created - content: - application/json: - schema: - description: subscription information - required: - - subscriptionId - properties: - subscriptionId: - description: this unique identifier allows management of the subscription - type: string - example: 2531329f-fb09-4ef7-887e-84e648214436 - callbacks: - # the name `onData` is a convenience locator - onData: - # when data is sent, it will be sent to the `callbackUrl` provided - # when making the subscription PLUS the suffix `/data` - '{$request.query.callbackUrl}/data': - post: - requestBody: - description: subscription payload - content: - application/json: - schema: - type: object - properties: - timestamp: - type: string - format: date-time - userData: - type: string - responses: - '202': - description: | - Your server implementation should return this HTTP status code - if the data was received successfully - '204': - description: | - Your server should return this HTTP status code if no longer interested - in further updates diff --git a/examples/v3.0/link-example.yaml b/examples/v3.0/link-example.yaml deleted file mode 100644 index 5837d705ee..0000000000 --- a/examples/v3.0/link-example.yaml +++ /dev/null @@ -1,203 +0,0 @@ -openapi: 3.0.0 -info: - title: Link Example - version: 1.0.0 -paths: - /2.0/users/{username}: - get: - operationId: getUserByName - parameters: - - name: username - in: path - required: true - schema: - type: string - responses: - '200': - description: The User - content: - application/json: - schema: - $ref: '#/components/schemas/user' - links: - userRepositories: - $ref: '#/components/links/UserRepositories' - /2.0/repositories/{username}: - get: - operationId: getRepositoriesByOwner - parameters: - - name: username - in: path - required: true - schema: - type: string - responses: - '200': - description: repositories owned by the supplied user - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/repository' - links: - userRepository: - $ref: '#/components/links/UserRepository' - /2.0/repositories/{username}/{slug}: - get: - operationId: getRepository - parameters: - - name: username - in: path - required: true - schema: - type: string - - name: slug - in: path - required: true - schema: - type: string - responses: - '200': - description: The repository - content: - application/json: - schema: - $ref: '#/components/schemas/repository' - links: - repositoryPullRequests: - $ref: '#/components/links/RepositoryPullRequests' - /2.0/repositories/{username}/{slug}/pullrequests: - get: - operationId: getPullRequestsByRepository - parameters: - - name: username - in: path - required: true - schema: - type: string - - name: slug - in: path - required: true - schema: - type: string - - name: state - in: query - schema: - type: string - enum: - - open - - merged - - declined - responses: - '200': - description: an array of pull request objects - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/pullrequest' - /2.0/repositories/{username}/{slug}/pullrequests/{pid}: - get: - operationId: getPullRequestsById - parameters: - - name: username - in: path - required: true - schema: - type: string - - name: slug - in: path - required: true - schema: - type: string - - name: pid - in: path - required: true - schema: - type: string - responses: - '200': - description: a pull request object - content: - application/json: - schema: - $ref: '#/components/schemas/pullrequest' - links: - pullRequestMerge: - $ref: '#/components/links/PullRequestMerge' - /2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge: - post: - operationId: mergePullRequest - parameters: - - name: username - in: path - required: true - schema: - type: string - - name: slug - in: path - required: true - schema: - type: string - - name: pid - in: path - required: true - schema: - type: string - responses: - '204': - description: the PR was successfully merged -components: - links: - UserRepositories: - # returns array of '#/components/schemas/repository' - operationId: getRepositoriesByOwner - parameters: - username: $response.body#/username - UserRepository: - # returns '#/components/schemas/repository' - operationId: getRepository - parameters: - username: $response.body#/owner/username - slug: $response.body#/slug - RepositoryPullRequests: - # returns '#/components/schemas/pullrequest' - operationId: getPullRequestsByRepository - parameters: - username: $response.body#/owner/username - slug: $response.body#/slug - PullRequestMerge: - # executes /2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge - operationId: mergePullRequest - parameters: - username: $response.body#/author/username - slug: $response.body#/repository/slug - pid: $response.body#/id - schemas: - user: - type: object - properties: - username: - type: string - uuid: - type: string - repository: - type: object - properties: - slug: - type: string - owner: - $ref: '#/components/schemas/user' - pullrequest: - type: object - properties: - id: - type: integer - title: - type: string - repository: - $ref: '#/components/schemas/repository' - author: - $ref: '#/components/schemas/user' diff --git a/examples/v3.0/petstore-expanded.yaml b/examples/v3.0/petstore-expanded.yaml deleted file mode 100644 index acd46d911b..0000000000 --- a/examples/v3.0/petstore-expanded.yaml +++ /dev/null @@ -1,158 +0,0 @@ -openapi: "3.0.0" -info: - version: 1.0.0 - title: Swagger Petstore - description: A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification - termsOfService: http://swagger.io/terms/ - contact: - name: Swagger API Team - email: apiteam@swagger.io - url: http://swagger.io - license: - name: Apache 2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html -servers: - - url: http://petstore.swagger.io/api -paths: - /pets: - get: - description: | - Returns all pets from the system that the user has access to - Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. - - Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. - operationId: findPets - parameters: - - name: tags - in: query - description: tags to filter by - required: false - style: form - schema: - type: array - items: - type: string - - name: limit - in: query - description: maximum number of results to return - required: false - schema: - type: integer - format: int32 - responses: - '200': - description: pet response - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Pet' - default: - description: unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - post: - description: Creates a new pet in the store. Duplicates are allowed - operationId: addPet - requestBody: - description: Pet to add to the store - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/NewPet' - responses: - '200': - description: pet response - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - default: - description: unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /pets/{id}: - get: - description: Returns a user based on a single ID, if the user does not have access to the pet - operationId: find pet by id - parameters: - - name: id - in: path - description: ID of pet to fetch - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: pet response - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - default: - description: unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: - description: deletes a single pet based on the ID supplied - operationId: deletePet - parameters: - - name: id - in: path - description: ID of pet to delete - required: true - schema: - type: integer - format: int64 - responses: - '204': - description: pet deleted - default: - description: unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' -components: - schemas: - Pet: - allOf: - - $ref: '#/components/schemas/NewPet' - - type: object - required: - - id - properties: - id: - type: integer - format: int64 - - NewPet: - type: object - required: - - name - properties: - name: - type: string - tag: - type: string - - Error: - type: object - required: - - code - - message - properties: - code: - type: integer - format: int32 - message: - type: string diff --git a/examples/v3.0/petstore.yaml b/examples/v3.0/petstore.yaml deleted file mode 100644 index 534bb0cd77..0000000000 --- a/examples/v3.0/petstore.yaml +++ /dev/null @@ -1,111 +0,0 @@ -openapi: "3.0.0" -info: - version: 1.0.0 - title: Swagger Petstore - license: - name: MIT -servers: - - url: http://petstore.swagger.io/v1 -paths: - /pets: - get: - summary: List all pets - operationId: listPets - tags: - - pets - parameters: - - name: limit - in: query - description: How many items to return at one time (max 100) - required: false - schema: - type: integer - format: int32 - responses: - '200': - description: A paged array of pets - headers: - x-next: - description: A link to the next page of responses - schema: - type: string - content: - application/json: - schema: - $ref: "#/components/schemas/Pets" - default: - description: unexpected error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - post: - summary: Create a pet - operationId: createPets - tags: - - pets - responses: - '201': - description: Null response - default: - description: unexpected error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - /pets/{petId}: - get: - summary: Info for a specific pet - operationId: showPetById - tags: - - pets - parameters: - - name: petId - in: path - required: true - description: The id of the pet to retrieve - schema: - type: string - responses: - '200': - description: Expected response to a valid request - content: - application/json: - schema: - $ref: "#/components/schemas/Pet" - default: - description: unexpected error - content: - application/json: - schema: - $ref: "#/components/schemas/Error" -components: - schemas: - Pet: - type: object - required: - - id - - name - properties: - id: - type: integer - format: int64 - name: - type: string - tag: - type: string - Pets: - type: array - items: - $ref: "#/components/schemas/Pet" - Error: - type: object - required: - - code - - message - properties: - code: - type: integer - format: int32 - message: - type: string diff --git a/examples/v3.0/uspto.yaml b/examples/v3.0/uspto.yaml deleted file mode 100644 index 8e9b159f52..0000000000 --- a/examples/v3.0/uspto.yaml +++ /dev/null @@ -1,210 +0,0 @@ -openapi: 3.0.1 -servers: - - url: '{scheme}://developer.uspto.gov/ds-api' - variables: - scheme: - description: 'The Data Set API is accessible via https and http' - enum: - - 'https' - - 'http' - default: 'https' -info: - description: >- - The Data Set API (DSAPI) allows the public users to discover and search - USPTO exported data sets. This is a generic API that allows USPTO users to - make any CSV based data files searchable through API. With the help of GET - call, it returns the list of data fields that are searchable. With the help - of POST call, data can be fetched based on the filters on the field names. - Please note that POST call is used to search the actual data. The reason for - the POST call is that it allows users to specify any complex search criteria - without worry about the GET size limitations as well as encoding of the - input parameters. - version: 1.0.0 - title: USPTO Data Set API - contact: - name: Open Data Portal - url: 'https://developer.uspto.gov' - email: developer@uspto.gov -tags: - - name: metadata - description: Find out about the data sets - - name: search - description: Search a data set -paths: - /: - get: - tags: - - metadata - operationId: list-data-sets - summary: List available data sets - responses: - '200': - description: Returns a list of data sets - content: - application/json: - schema: - $ref: '#/components/schemas/dataSetList' - example: - { - "total": 2, - "apis": [ - { - "apiKey": "oa_citations", - "apiVersionNumber": "v1", - "apiUrl": "https://developer.uspto.gov/ds-api/oa_citations/v1/fields", - "apiDocumentationUrl": "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/oa_citations.json" - }, - { - "apiKey": "cancer_moonshot", - "apiVersionNumber": "v1", - "apiUrl": "https://developer.uspto.gov/ds-api/cancer_moonshot/v1/fields", - "apiDocumentationUrl": "https://developer.uspto.gov/ds-api-docs/index.html?url=https://developer.uspto.gov/ds-api/swagger/docs/cancer_moonshot.json" - } - ] - } - /{dataset}/{version}/fields: - get: - tags: - - metadata - summary: >- - Provides the general information about the API and the list of fields - that can be used to query the dataset. - description: >- - This GET API returns the list of all the searchable field names that are - in the oa_citations. Please see the 'fields' attribute which returns an - array of field names. Each field or a combination of fields can be - searched using the syntax options shown below. - operationId: list-searchable-fields - parameters: - - name: dataset - in: path - description: 'Name of the dataset.' - required: true - example: "oa_citations" - schema: - type: string - - name: version - in: path - description: Version of the dataset. - required: true - example: "v1" - schema: - type: string - responses: - '200': - description: >- - The dataset API for the given version is found and it is accessible - to consume. - content: - application/json: - schema: - type: string - '404': - description: >- - The combination of dataset name and version is not found in the - system or it is not published yet to be consumed by public. - content: - application/json: - schema: - type: string - /{dataset}/{version}/records: - post: - tags: - - search - summary: >- - Provides search capability for the data set with the given search - criteria. - description: >- - This API is based on Solr/Lucense Search. The data is indexed using - SOLR. This GET API returns the list of all the searchable field names - that are in the Solr Index. Please see the 'fields' attribute which - returns an array of field names. Each field or a combination of fields - can be searched using the Solr/Lucene Syntax. Please refer - https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for - the query syntax. List of field names that are searchable can be - determined using above GET api. - operationId: perform-search - parameters: - - name: version - in: path - description: Version of the dataset. - required: true - schema: - type: string - default: v1 - - name: dataset - in: path - description: 'Name of the dataset. In this case, the default value is oa_citations' - required: true - schema: - type: string - default: oa_citations - responses: - '200': - description: successful operation - content: - application/json: - schema: - type: array - items: - type: object - additionalProperties: - type: object - '404': - description: No matching record found for the given criteria. - requestBody: - content: - application/x-www-form-urlencoded: - schema: - type: object - properties: - criteria: - description: >- - Uses Lucene Query Syntax in the format of - propertyName:value, propertyName:[num1 TO num2] and date - range format: propertyName:[yyyyMMdd TO yyyyMMdd]. In the - response please see the 'docs' element which has the list of - record objects. Each record structure would consist of all - the fields and their corresponding values. - type: string - default: '*:*' - start: - description: Starting record number. Default value is 0. - type: integer - default: 0 - rows: - description: >- - Specify number of rows to be returned. If you run the search - with default values, in the response you will see 'numFound' - attribute which will tell the number of records available in - the dataset. - type: integer - default: 100 - required: - - criteria -components: - schemas: - dataSetList: - type: object - properties: - total: - type: integer - apis: - type: array - items: - type: object - properties: - apiKey: - type: string - description: To be used as a dataset parameter value - apiVersionNumber: - type: string - description: To be used as a version parameter value - apiUrl: - type: string - format: uriref - description: "The URL describing the dataset's fields" - apiDocumentationUrl: - type: string - format: uriref - description: A URL to the API console for each API From 2fb765187d36cb4fbff6dbea4e53edcaf93171ec Mon Sep 17 00:00:00 2001 From: Bellangelo Date: Sat, 15 Jun 2024 03:14:02 +0300 Subject: [PATCH 2/2] Update links to examples --- versions/3.0.0.md | 2 +- versions/3.0.1.md | 2 +- versions/3.0.2.md | 2 +- versions/3.0.3.md | 2 +- versions/3.0.4.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/versions/3.0.0.md b/versions/3.0.0.md index 30a041ad84..d2ab0c8c90 100644 --- a/versions/3.0.0.md +++ b/versions/3.0.0.md @@ -1821,7 +1821,7 @@ The key value used to identify the callback object is an expression, evaluated a ##### Patterned Fields Field Pattern | Type | Description ---|:---:|--- -{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available. +{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](https://github.com/OAI/learn.openapis.org/tree/main/examples/v3.0/callback-example.yaml) is available. This object MAY be extended with [Specification Extensions](#specificationExtensions). diff --git a/versions/3.0.1.md b/versions/3.0.1.md index 0a8a834358..c2e9f7bc80 100644 --- a/versions/3.0.1.md +++ b/versions/3.0.1.md @@ -1821,7 +1821,7 @@ The key value used to identify the callback object is an expression, evaluated a ##### Patterned Fields Field Pattern | Type | Description ---|:---:|--- -{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available. +{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](https://github.com/OAI/learn.openapis.org/tree/main/examples/v3.0/callback-example.yaml) is available. This object MAY be extended with [Specification Extensions](#specificationExtensions). diff --git a/versions/3.0.2.md b/versions/3.0.2.md index 3a6a343a8c..9574d78cca 100644 --- a/versions/3.0.2.md +++ b/versions/3.0.2.md @@ -1843,7 +1843,7 @@ The key value used to identify the callback object is an expression, evaluated a ##### Patterned Fields Field Pattern | Type | Description ---|:---:|--- -{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available. +{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](https://github.com/OAI/learn.openapis.org/tree/main/examples/v3.0/callback-example.yaml) is available. This object MAY be extended with [Specification Extensions](#specificationExtensions). diff --git a/versions/3.0.3.md b/versions/3.0.3.md index e21aa46554..cd64551a66 100644 --- a/versions/3.0.3.md +++ b/versions/3.0.3.md @@ -1847,7 +1847,7 @@ The key value used to identify the path item object is an expression, evaluated ##### Patterned Fields Field Pattern | Type | Description ---|:---:|--- -{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available. +{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](https://github.com/OAI/learn.openapis.org/tree/main/examples/v3.0/callback-example.yaml) is available. This object MAY be extended with [Specification Extensions](#specificationExtensions). diff --git a/versions/3.0.4.md b/versions/3.0.4.md index ca69bddc6b..ca646baa95 100644 --- a/versions/3.0.4.md +++ b/versions/3.0.4.md @@ -1863,7 +1863,7 @@ The key value used to identify the path item object is an expression, evaluated ##### Patterned Fields Field Pattern | Type | Description ---|:---:|--- -{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](../examples/v3.0/callback-example.yaml) is available. +{expression} | [Path Item Object](#pathItemObject) | A Path Item Object used to define a callback request and expected responses. A [complete example](https://github.com/OAI/learn.openapis.org/tree/main/examples/v3.0/callback-example.yaml) is available. This object MAY be extended with [Specification Extensions](#specificationExtensions).