diff --git a/examples/v3.0/api-with-examples.yaml b/examples/v3.0/api-with-examples.yaml index 62733df..d541060 100644 --- a/examples/v3.0/api-with-examples.yaml +++ b/examples/v3.0/api-with-examples.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: '3.0.0' info: title: Simple API overview version: 2.0.0 @@ -8,7 +8,7 @@ paths: operationId: listVersionsv2 summary: List API versions responses: - "200": + '200': description: |- 200 response content: @@ -17,35 +17,35 @@ paths: foo: value: { - "versions": + 'versions': [ { - "status": "CURRENT", - "updated": "2011-01-21T11:33:21Z", - "id": "v2.0", - "links": + 'status': 'CURRENT', + 'updated': '2011-01-21T11:33:21Z', + 'id': 'v2.0', + 'links': [ { - "href": "http://127.0.0.1:8774/v2/", - "rel": "self", + 'href': 'http://127.0.0.1:8774/v2/', + 'rel': 'self', }, ], }, { - "status": "EXPERIMENTAL", - "updated": "2013-07-23T11:33:21Z", - "id": "v3.0", - "links": + 'status': 'EXPERIMENTAL', + 'updated': '2013-07-23T11:33:21Z', + 'id': 'v3.0', + 'links': [ { - "href": "http://127.0.0.1:8774/v3/", - "rel": "self", + 'href': 'http://127.0.0.1:8774/v3/', + 'rel': 'self', }, ], }, ], } - "300": + '300': description: |- 300 response content: @@ -84,7 +84,7 @@ paths: operationId: getVersionDetailsv2 summary: Show API version details responses: - "200": + '200': description: |- 200 response content: @@ -93,47 +93,47 @@ paths: foo: value: { - "version": + 'version': { - "status": "CURRENT", - "updated": "2011-01-21T11:33:21Z", - "media-types": + 'status': 'CURRENT', + 'updated': '2011-01-21T11:33:21Z', + 'media-types': [ { - "base": "application/xml", - "type": "application/vnd.openstack.compute+xml;version=2", + 'base': 'application/xml', + 'type': 'application/vnd.openstack.compute+xml;version=2', }, { - "base": "application/json", - "type": "application/vnd.openstack.compute+json;version=2", + 'base': 'application/json', + 'type': 'application/vnd.openstack.compute+json;version=2', }, ], - "id": "v2.0", - "links": + 'id': 'v2.0', + 'links': [ { - "href": "http://127.0.0.1:8774/v2/", - "rel": "self", + '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/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', }, { - "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": + '203': description: |- 203 response content: @@ -142,37 +142,37 @@ paths: foo: value: { - "version": + 'version': { - "status": "CURRENT", - "updated": "2011-01-21T11:33:21Z", - "media-types": + 'status': 'CURRENT', + 'updated': '2011-01-21T11:33:21Z', + 'media-types': [ { - "base": "application/xml", - "type": "application/vnd.openstack.compute+xml;version=2", + 'base': 'application/xml', + 'type': 'application/vnd.openstack.compute+xml;version=2', }, { - "base": "application/json", - "type": "application/vnd.openstack.compute+json;version=2", + 'base': 'application/json', + 'type': 'application/vnd.openstack.compute+json;version=2', }, ], - "id": "v2.0", - "links": + 'id': 'v2.0', + 'links': [ { - "href": "http://23.253.228.211:8774/v2/", - "rel": "self", + '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/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', }, ], }, diff --git a/examples/v3.0/callback-example.yaml b/examples/v3.0/callback-example.yaml index 0bd0f93..262b8df 100644 --- a/examples/v3.0/callback-example.yaml +++ b/examples/v3.0/callback-example.yaml @@ -18,7 +18,7 @@ paths: format: uri example: https://tonys-server.com responses: - "201": + '201': description: subscription successfully created content: application/json: @@ -36,7 +36,7 @@ paths: onData: # when data is sent, it will be sent to the `callbackUrl` provided # when making the subscription PLUS the suffix `/data` - "{$request.query.callbackUrl}/data": + '{$request.query.callbackUrl}/data': post: requestBody: description: subscription payload @@ -51,11 +51,11 @@ paths: userData: type: string responses: - "202": + '202': description: | Your server implementation should return this HTTP status code if the data was received successfully - "204": + '204': description: | Your server should return this HTTP status code if no longer interested in further updates diff --git a/examples/v3.0/link-example.yaml b/examples/v3.0/link-example.yaml index 8616f32..ea90bdc 100644 --- a/examples/v3.0/link-example.yaml +++ b/examples/v3.0/link-example.yaml @@ -13,15 +13,15 @@ paths: schema: type: string responses: - "200": + '200': description: The User content: application/json: schema: - $ref: "#/components/schemas/user" + $ref: '#/components/schemas/user' links: userRepositories: - $ref: "#/components/links/UserRepositories" + $ref: '#/components/links/UserRepositories' /2.0/repositories/{username}: get: operationId: getRepositoriesByOwner @@ -32,17 +32,17 @@ paths: schema: type: string responses: - "200": + '200': description: repositories owned by the supplied user content: application/json: schema: type: array items: - $ref: "#/components/schemas/repository" + $ref: '#/components/schemas/repository' links: userRepository: - $ref: "#/components/links/UserRepository" + $ref: '#/components/links/UserRepository' /2.0/repositories/{username}/{slug}: get: operationId: getRepository @@ -58,15 +58,15 @@ paths: schema: type: string responses: - "200": + '200': description: The repository content: application/json: schema: - $ref: "#/components/schemas/repository" + $ref: '#/components/schemas/repository' links: repositoryPullRequests: - $ref: "#/components/links/RepositoryPullRequests" + $ref: '#/components/links/RepositoryPullRequests' /2.0/repositories/{username}/{slug}/pullrequests: get: operationId: getPullRequestsByRepository @@ -90,14 +90,14 @@ paths: - merged - declined responses: - "200": + '200': description: an array of pull request objects content: application/json: schema: type: array items: - $ref: "#/components/schemas/pullrequest" + $ref: '#/components/schemas/pullrequest' /2.0/repositories/{username}/{slug}/pullrequests/{pid}: get: operationId: getPullRequestsById @@ -118,15 +118,15 @@ paths: schema: type: string responses: - "200": + '200': description: a pull request object content: application/json: schema: - $ref: "#/components/schemas/pullrequest" + $ref: '#/components/schemas/pullrequest' links: pullRequestMerge: - $ref: "#/components/links/PullRequestMerge" + $ref: '#/components/links/PullRequestMerge' /2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge: post: operationId: mergePullRequest @@ -147,7 +147,7 @@ paths: schema: type: string responses: - "204": + '204': description: the PR was successfully merged components: links: @@ -189,7 +189,7 @@ components: slug: type: string owner: - $ref: "#/components/schemas/user" + $ref: '#/components/schemas/user' pullrequest: type: object properties: @@ -198,6 +198,6 @@ components: title: type: string repository: - $ref: "#/components/schemas/repository" + $ref: '#/components/schemas/repository' author: - $ref: "#/components/schemas/user" + $ref: '#/components/schemas/user' diff --git a/examples/v3.0/petstore-expanded.yaml b/examples/v3.0/petstore-expanded.yaml index fdeee95..c4d59a6 100644 --- a/examples/v3.0/petstore-expanded.yaml +++ b/examples/v3.0/petstore-expanded.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: '3.0.0' info: version: 1.0.0 title: Swagger Petstore @@ -40,20 +40,20 @@ paths: type: integer format: int32 responses: - "200": + '200': description: pet response content: application/json: schema: type: array items: - $ref: "#/components/schemas/Pet" + $ref: '#/components/schemas/Pet' default: description: unexpected error content: application/json: schema: - $ref: "#/components/schemas/Error" + $ref: '#/components/schemas/Error' post: description: Creates a new pet in the store. Duplicates are allowed operationId: addPet @@ -63,20 +63,20 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/NewPet" + $ref: '#/components/schemas/NewPet' responses: - "200": + '200': description: pet response content: application/json: schema: - $ref: "#/components/schemas/Pet" + $ref: '#/components/schemas/Pet' default: description: unexpected error content: application/json: schema: - $ref: "#/components/schemas/Error" + $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 @@ -90,18 +90,18 @@ paths: type: integer format: int64 responses: - "200": + '200': description: pet response content: application/json: schema: - $ref: "#/components/schemas/Pet" + $ref: '#/components/schemas/Pet' default: description: unexpected error content: application/json: schema: - $ref: "#/components/schemas/Error" + $ref: '#/components/schemas/Error' delete: description: deletes a single pet based on the ID supplied operationId: deletePet @@ -114,19 +114,19 @@ paths: type: integer format: int64 responses: - "204": + '204': description: pet deleted default: description: unexpected error content: application/json: schema: - $ref: "#/components/schemas/Error" + $ref: '#/components/schemas/Error' components: schemas: Pet: allOf: - - $ref: "#/components/schemas/NewPet" + - $ref: '#/components/schemas/NewPet' - type: object required: - id diff --git a/examples/v3.0/petstore.yaml b/examples/v3.0/petstore.yaml index a956f24..b01683d 100644 --- a/examples/v3.0/petstore.yaml +++ b/examples/v3.0/petstore.yaml @@ -1,4 +1,4 @@ -openapi: "3.0.0" +openapi: '3.0.0' info: version: 1.0.0 title: Swagger Petstore @@ -23,7 +23,7 @@ paths: maximum: 100 format: int32 responses: - "200": + '200': description: A paged array of pets headers: x-next: @@ -33,13 +33,13 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Pets" + $ref: '#/components/schemas/Pets' default: description: unexpected error content: application/json: schema: - $ref: "#/components/schemas/Error" + $ref: '#/components/schemas/Error' post: summary: Create a pet operationId: createPets @@ -49,17 +49,17 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Pet" + $ref: '#/components/schemas/Pet' required: true responses: - "201": + '201': description: Null response default: description: unexpected error content: application/json: schema: - $ref: "#/components/schemas/Error" + $ref: '#/components/schemas/Error' /pets/{petId}: get: summary: Info for a specific pet @@ -74,18 +74,18 @@ paths: schema: type: string responses: - "200": + '200': description: Expected response to a valid request content: application/json: schema: - $ref: "#/components/schemas/Pet" + $ref: '#/components/schemas/Pet' default: description: unexpected error content: application/json: schema: - $ref: "#/components/schemas/Error" + $ref: '#/components/schemas/Error' components: schemas: Pet: @@ -105,7 +105,7 @@ components: type: array maxItems: 100 items: - $ref: "#/components/schemas/Pet" + $ref: '#/components/schemas/Pet' Error: type: object required: diff --git a/examples/v3.0/uspto.yaml b/examples/v3.0/uspto.yaml index fb9d7e7..2186e50 100644 --- a/examples/v3.0/uspto.yaml +++ b/examples/v3.0/uspto.yaml @@ -1,13 +1,13 @@ openapi: 3.0.1 servers: - - url: "{scheme}://developer.uspto.gov/ds-api" + - url: '{scheme}://developer.uspto.gov/ds-api' variables: scheme: - description: "The Data Set API is accessible via https and http" + description: 'The Data Set API is accessible via https and http' enum: - - "https" - - "http" - default: "https" + - 'https' + - 'http' + default: 'https' info: description: >- The Data Set API (DSAPI) allows the public users to discover and search @@ -23,7 +23,7 @@ info: title: USPTO Data Set API contact: name: Open Data Portal - url: "https://developer.uspto.gov" + url: 'https://developer.uspto.gov' email: developer@uspto.gov tags: - name: metadata @@ -38,28 +38,28 @@ paths: operationId: list-data-sets summary: List available data sets responses: - "200": + '200': description: Returns a list of data sets content: application/json: schema: - $ref: "#/components/schemas/dataSetList" + $ref: '#/components/schemas/dataSetList' example: { - "total": 2, - "apis": + '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': '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", + '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', }, ], } @@ -79,20 +79,20 @@ paths: parameters: - name: dataset in: path - description: "Name of the dataset." + description: 'Name of the dataset.' required: true - example: "oa_citations" + example: 'oa_citations' schema: type: string - name: version in: path description: Version of the dataset. required: true - example: "v1" + example: 'v1' schema: type: string responses: - "200": + '200': description: >- The dataset API for the given version is found and it is accessible to consume. @@ -100,7 +100,7 @@ paths: application/json: schema: type: string - "404": + '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. @@ -135,13 +135,13 @@ paths: default: v1 - name: dataset in: path - description: "Name of the dataset. In this case, the default value is oa_citations" + description: 'Name of the dataset. In this case, the default value is oa_citations' required: true schema: type: string default: oa_citations responses: - "200": + '200': description: successful operation content: application/json: @@ -151,7 +151,7 @@ paths: type: object additionalProperties: type: object - "404": + '404': description: No matching record found for the given criteria. requestBody: content: @@ -168,7 +168,7 @@ paths: record objects. Each record structure would consist of all the fields and their corresponding values. type: string - default: "*:*" + default: '*:*' start: description: Starting record number. Default value is 0. type: integer diff --git a/examples/v3.1/non-oauth-scopes.yaml b/examples/v3.1/non-oauth-scopes.yaml index 0a79135..2e20847 100644 --- a/examples/v3.1/non-oauth-scopes.yaml +++ b/examples/v3.1/non-oauth-scopes.yaml @@ -7,12 +7,12 @@ paths: get: security: - bearerAuth: - - "read:users" - - "public" + - 'read:users' + - 'public' components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: jwt - description: "note: non-oauth scopes are not defined at the securityScheme level" + description: 'note: non-oauth scopes are not defined at the securityScheme level' diff --git a/examples/v3.1/tictactoe.yaml b/examples/v3.1/tictactoe.yaml index ddf3058..3541543 100644 --- a/examples/v3.1/tictactoe.yaml +++ b/examples/v3.1/tictactoe.yaml @@ -17,12 +17,12 @@ paths: - Gameplay operationId: get-board responses: - "200": - description: "OK" + '200': + description: 'OK' content: application/json: schema: - $ref: "#/components/schemas/status" + $ref: '#/components/schemas/status' security: - apiKey: [] - app2AppOauth: @@ -31,8 +31,8 @@ paths: # Single square operations /board/{row}/{column}: parameters: - - $ref: "#/components/parameters/rowParam" - - $ref: "#/components/parameters/columnParam" + - $ref: '#/components/parameters/rowParam' + - $ref: '#/components/parameters/columnParam' get: summary: Get a single board square description: Retrieves the requested square. @@ -40,19 +40,19 @@ paths: - Gameplay operationId: get-square responses: - "200": - description: "OK" + '200': + description: 'OK' content: application/json: schema: - $ref: "#/components/schemas/mark" - "400": + $ref: '#/components/schemas/mark' + '400': description: The provided parameters are incorrect content: text/html: schema: - $ref: "#/components/schemas/errorMessage" - example: "Illegal coordinates" + $ref: '#/components/schemas/errorMessage' + example: 'Illegal coordinates' security: - bearerHttpAuthentication: [] - user2AppOauth: @@ -68,27 +68,27 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/mark" + $ref: '#/components/schemas/mark' responses: - "200": - description: "OK" + '200': + description: 'OK' content: application/json: schema: - $ref: "#/components/schemas/status" - "400": + $ref: '#/components/schemas/status' + '400': description: The provided parameters are incorrect content: text/html: schema: - $ref: "#/components/schemas/errorMessage" + $ref: '#/components/schemas/errorMessage' examples: illegalCoordinates: - value: "Illegal coordinates." + value: 'Illegal coordinates.' notEmpty: - value: "Square is not empty." + value: 'Square is not empty.' invalidMark: - value: "Invalid Mark (X or O)." + value: 'Invalid Mark (X or O).' security: - bearerHttpAuthentication: [] - user2AppOauth: @@ -102,14 +102,14 @@ components: in: path required: true schema: - $ref: "#/components/schemas/coordinate" + $ref: '#/components/schemas/coordinate' columnParam: description: Board column (horizontal coordinate) name: column in: path required: true schema: - $ref: "#/components/schemas/coordinate" + $ref: '#/components/schemas/coordinate' schemas: errorMessage: type: string @@ -122,9 +122,9 @@ components: example: 1 mark: type: string - enum: [".", "X", "O"] + enum: ['.', 'X', 'O'] description: Possible values for a board square. `.` means empty square. - example: "." + example: '.' board: type: array maxItems: 3 @@ -134,19 +134,19 @@ components: maxItems: 3 minItems: 3 items: - $ref: "#/components/schemas/mark" + $ref: '#/components/schemas/mark' winner: type: string - enum: [".", "X", "O"] + enum: ['.', 'X', 'O'] description: Winner of the game. `.` means nobody has won yet. - example: "." + example: '.' status: type: object properties: winner: - $ref: "#/components/schemas/winner" + $ref: '#/components/schemas/winner' board: - $ref: "#/components/schemas/board" + $ref: '#/components/schemas/board' securitySchemes: defaultApiKey: description: API key provided in console diff --git a/examples/v3.1/webhook-example.yaml b/examples/v3.1/webhook-example.yaml index 44fc73a..7aa10cf 100644 --- a/examples/v3.1/webhook-example.yaml +++ b/examples/v3.1/webhook-example.yaml @@ -13,9 +13,9 @@ webhooks: content: application/json: schema: - $ref: "#/components/schemas/Pet" + $ref: '#/components/schemas/Pet' responses: - "200": + '200': description: Return a 200 status to indicate that the data was received successfully components: