diff --git a/.github/workflows/convert-examples-to-json.yaml b/.github/workflows/convert-examples-to-json.yaml
deleted file mode 100644
index d1b9768275..0000000000
--- a/.github/workflows/convert-examples-to-json.yaml
+++ /dev/null
@@ -1,53 +0,0 @@
-name: convert-examples-to-json
-
-# author: @MikeRalphson / @cebe
-# issue: https://github.com/OAI/OpenAPI-Specification/issues/1385
-
-#
-# This workflow updates the *.json files in the examples/v3.x directories,
-# when the corresponding *.yaml files change.
-# JSON example files are automatically generated from the YAML example files.
-# Only the YAML files should be adjusted manually.
-#
-
-# run this on push to main
-on:
- push:
- branches:
- - main
-
-jobs:
- yaml2json:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2 # checkout repo content
-
- - uses: actions/setup-node@v4 # setup Node.js
- with:
- node-version: '20.x'
-
- - name: Install dependencies
- run: npm ci
-
- - name: convert YAML examples to JSON
- run: find examples/v3* -type f -name "*.yaml" | xargs node scripts/yaml2json/yaml2json.js
-
- - name: git diff
- run: |
- git add examples/**/*.json
- git --no-pager -c color.diff=always diff --staged
-
- - name: Create Pull Request
- uses: peter-evans/create-pull-request@v5
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- branch: update-json-examples
- title: Update JSON example files
- commit-message: Update JSON example files
- body: |
- This pull request is automatically triggered by GitHub action `convert-examples-to-json`.
-
- The examples/v3.* YAML files have changed, so the JSON files are automatically being recreated.
-
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.json b/examples/v3.0/api-with-examples.json
deleted file mode 100644
index 0fd2077b3e..0000000000
--- a/examples/v3.0/api-with-examples.json
+++ /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": "{\n \"versions\": [\n {\n \"status\": \"CURRENT\",\n \"updated\": \"2011-01-21T11:33:21Z\",\n \"id\": \"v2.0\",\n \"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v2/\",\n \"rel\": \"self\"\n }\n ]\n },\n {\n \"status\": \"EXPERIMENTAL\",\n \"updated\": \"2013-07-23T11:33:21Z\",\n \"id\": \"v3.0\",\n \"links\": [\n {\n \"href\": \"http://127.0.0.1:8774/v3/\",\n \"rel\": \"self\"\n }\n ]\n }\n ]\n}\n"
- }
- }
- }
- }
- }
- }
- }
- },
- "/v2": {
- "get": {
- "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"
- }
- ]
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/examples/v3.0/callback-example.json b/examples/v3.0/callback-example.json
deleted file mode 100644
index 9a4df39b45..0000000000
--- a/examples/v3.0/callback-example.json
+++ /dev/null
@@ -1,84 +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\nby the source server\n",
- "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": {
- "onData": {
- "{$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\nif the data was received successfully\n"
- },
- "204": {
- "description": "Your server should return this HTTP status code if no longer interested\nin further updates\n"
- }
- }
- }
- }
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/examples/v3.0/link-example.json b/examples/v3.0/link-example.json
deleted file mode 100644
index bc98e635f1..0000000000
--- a/examples/v3.0/link-example.json
+++ /dev/null
@@ -1,323 +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": {
- "operationId": "getRepositoriesByOwner",
- "parameters": {
- "username": "$response.body#/username"
- }
- },
- "UserRepository": {
- "operationId": "getRepository",
- "parameters": {
- "username": "$response.body#/owner/username",
- "slug": "$response.body#/slug"
- }
- },
- "RepositoryPullRequests": {
- "operationId": "getPullRequestsByRepository",
- "parameters": {
- "username": "$response.body#/owner/username",
- "slug": "$response.body#/slug"
- }
- },
- "PullRequestMerge": {
- "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"
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/examples/v3.0/petstore-expanded.json b/examples/v3.0/petstore-expanded.json
deleted file mode 100644
index 420eede6a8..0000000000
--- a/examples/v3.0/petstore-expanded.json
+++ /dev/null
@@ -1,242 +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": "https://petstore.swagger.io/v2"
- }
- ],
- "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,
- "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"
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/examples/v3.0/petstore.json b/examples/v3.0/petstore.json
deleted file mode 100644
index d14eb5e6d0..0000000000
--- a/examples/v3.0/petstore.json
+++ /dev/null
@@ -1,189 +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",
- "maximum": 100,
- "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"
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Pet"
- }
- }
- },
- "required": true
- },
- "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",
- "maxItems": 100,
- "items": {
- "$ref": "#/components/schemas/Pet"
- }
- },
- "Error": {
- "type": "object",
- "required": [
- "code",
- "message"
- ],
- "properties": {
- "code": {
- "type": "integer",
- "format": "int32"
- },
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/examples/v3.0/uspto.json b/examples/v3.0/uspto.json
deleted file mode 100644
index cd32f64c5f..0000000000
--- a/examples/v3.0/uspto.json
+++ /dev/null
@@ -1,252 +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/Lucene 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"
- }
- }
- }
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/examples/v3.1/non-oauth-scopes.json b/examples/v3.1/non-oauth-scopes.json
deleted file mode 100644
index b3e5990426..0000000000
--- a/examples/v3.1/non-oauth-scopes.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "openapi": "3.1.0",
- "info": {
- "title": "Non-oAuth Scopes example",
- "version": "1.0.0"
- },
- "paths": {
- "/users": {
- "get": {
- "security": [
- {
- "bearerAuth": [
- "read:users",
- "public"
- ]
- }
- ]
- }
- }
- },
- "components": {
- "securitySchemes": {
- "bearerAuth": {
- "type": "http",
- "scheme": "bearer",
- "bearerFormat": "jwt",
- "description": "note: non-oauth scopes are not defined at the securityScheme level"
- }
- }
- }
-}
\ No newline at end of file
diff --git a/examples/v3.1/webhook-example.json b/examples/v3.1/webhook-example.json
deleted file mode 100644
index 712a42f120..0000000000
--- a/examples/v3.1/webhook-example.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "openapi": "3.1.0",
- "info": {
- "title": "Webhook Example",
- "version": "1.0.0"
- },
- "webhooks": {
- "newPet": {
- "post": {
- "requestBody": {
- "description": "Information about a new pet in the system",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Pet"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Return a 200 status to indicate that the data was received successfully"
- }
- }
- }
- }
- },
- "components": {
- "schemas": {
- "Pet": {
- "required": [
- "id",
- "name"
- ],
- "properties": {
- "id": {
- "type": "integer",
- "format": "int64"
- },
- "name": {
- "type": "string"
- },
- "tag": {
- "type": "string"
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/tests/md2html/md2html.test.js b/tests/md2html/md2html.test.mjs
similarity index 95%
rename from tests/md2html/md2html.test.js
rename to tests/md2html/md2html.test.mjs
index 3309611d55..f3141b5e33 100644
--- a/tests/md2html/md2html.test.js
+++ b/tests/md2html/md2html.test.mjs
@@ -5,7 +5,7 @@ import { describe, test, expect } from "vitest";
import assert from "node:assert";
const folder = "./tests/md2html/fixtures/";
-describe("v3.0 - Validate examples", async () => {
+describe("md2html", async () => {
readdirSync(folder, { withFileTypes: true })
.filter((entry) => entry.isFile() && /\.md$/.test(entry.name))
.forEach((entry) => {
diff --git a/examples/v3.0/api-with-examples.yaml b/tests/v3.0/pass/api-with-examples.yaml
similarity index 100%
rename from examples/v3.0/api-with-examples.yaml
rename to tests/v3.0/pass/api-with-examples.yaml
diff --git a/examples/v3.0/callback-example.yaml b/tests/v3.0/pass/callback-example.yaml
similarity index 100%
rename from examples/v3.0/callback-example.yaml
rename to tests/v3.0/pass/callback-example.yaml
diff --git a/examples/v3.0/link-example.yaml b/tests/v3.0/pass/link-example.yaml
similarity index 100%
rename from examples/v3.0/link-example.yaml
rename to tests/v3.0/pass/link-example.yaml
diff --git a/examples/v3.0/petstore-expanded.yaml b/tests/v3.0/pass/petstore-expanded.yaml
similarity index 100%
rename from examples/v3.0/petstore-expanded.yaml
rename to tests/v3.0/pass/petstore-expanded.yaml
diff --git a/examples/v3.0/petstore.yaml b/tests/v3.0/pass/petstore.yaml
similarity index 100%
rename from examples/v3.0/petstore.yaml
rename to tests/v3.0/pass/petstore.yaml
diff --git a/examples/v3.0/uspto.yaml b/tests/v3.0/pass/uspto.yaml
similarity index 100%
rename from examples/v3.0/uspto.yaml
rename to tests/v3.0/pass/uspto.yaml
diff --git a/tests/v3.0/examples.test.js b/tests/v3.0/schema.test.mjs
similarity index 94%
rename from tests/v3.0/examples.test.js
rename to tests/v3.0/schema.test.mjs
index 19c13de13c..edc1bf7c42 100644
--- a/tests/v3.0/examples.test.js
+++ b/tests/v3.0/schema.test.mjs
@@ -27,9 +27,9 @@ const parseYamlFromFile = (filePath) => {
setMetaSchemaOutputFormat(BASIC);
const validateOpenApi = await validate("./schemas/v3.0/schema.yaml");
-const folder = './examples/v3.0/';
+const folder = './tests/v3.0/pass/';
-describe("v3.0 - Validate examples", async () => {
+describe("pass", async () => {
readdirSync(folder, { withFileTypes: true })
.filter((entry) => entry.isFile() && /\.yaml$/.test(entry.name))
.forEach((entry) => {
diff --git a/tests/v3.1/examples.test.js b/tests/v3.1/examples.test.js
deleted file mode 100644
index d23fc0ffda..0000000000
--- a/tests/v3.1/examples.test.js
+++ /dev/null
@@ -1,42 +0,0 @@
-import { readdirSync, readFileSync } from "node:fs";
-import YAML from "yaml";
-import { validate, setMetaSchemaOutputFormat } from "@hyperjump/json-schema/openapi-3-1";
-import { BASIC } from "@hyperjump/json-schema/experimental";
-import { describe, test, expect } from "vitest";
-
-import contentTypeParser from "content-type";
-import { addMediaTypePlugin } from "@hyperjump/browser";
-import { buildSchemaDocument } from "@hyperjump/json-schema/experimental";
-
-addMediaTypePlugin("application/schema+yaml", {
- parse: async (response) => {
- const contentType = contentTypeParser.parse(response.headers.get("content-type") ?? "");
- const contextDialectId = contentType.parameters.schema ?? contentType.parameters.profile;
-
- const foo = YAML.parse(await response.text());
- return buildSchemaDocument(foo, response.url, contextDialectId);
- },
- fileMatcher: (path) => path.endsWith(".yaml")
- });
-
-const parseYamlFromFile = (filePath) => {
- const schemaYaml = readFileSync(filePath, "utf8");
- return YAML.parse(schemaYaml, { prettyErrors: true });
-};
-
-setMetaSchemaOutputFormat(BASIC);
-
-const validateOpenApi = await validate("./schemas/v3.1/schema.yaml");
-const folder = './examples/v3.1/';
-
-describe("v3.1 - Validate examples", async () => {
- readdirSync(folder, { withFileTypes: true })
- .filter((entry) => entry.isFile() && /\.yaml$/.test(entry.name))
- .forEach((entry) => {
- test(entry.name, () => {
- const instance = parseYamlFromFile(folder + entry.name);
- const output = validateOpenApi(instance, BASIC);
- expect(output.valid).to.equal(true);
- });
- });
-});
diff --git a/examples/v3.1/non-oauth-scopes.yaml b/tests/v3.1/pass/non-oauth-scopes.yaml
similarity index 100%
rename from examples/v3.1/non-oauth-scopes.yaml
rename to tests/v3.1/pass/non-oauth-scopes.yaml
diff --git a/examples/v3.1/webhook-example.yaml b/tests/v3.1/pass/webhook-example.yaml
similarity index 100%
rename from examples/v3.1/webhook-example.yaml
rename to tests/v3.1/pass/webhook-example.yaml
diff --git a/vitest.config.js b/vitest.config.mjs
similarity index 100%
rename from vitest.config.js
rename to vitest.config.mjs