chore: use prettier more (#1109)

This commit is contained in:
Andrew Tatomyr
2023-05-31 13:01:20 +03:00
committed by GitHub
parent 3e287a80eb
commit fb47a20b8c
123 changed files with 739 additions and 757 deletions

View File

@@ -18,6 +18,7 @@ Hi! We're really excited that you are interested in contributing to Redocly CLI.
- Abide by our [Code of Conduct](https://redocly.com/code-of-conduct/) in all your interactions on this repository, and show patience and respect to other community members. - Abide by our [Code of Conduct](https://redocly.com/code-of-conduct/) in all your interactions on this repository, and show patience and respect to other community members.
## Pull Request Guidelines ## Pull Request Guidelines
Before submitting a pull request, please make sure the following is done: Before submitting a pull request, please make sure the following is done:
1. Fork the repository and create your branch from `main`. 1. Fork the repository and create your branch from `main`.
@@ -38,7 +39,7 @@ $ npm install # or npm i
### Commonly used NPM scripts ### Commonly used NPM scripts
``` bash ```bash
# run a separate CLI command # run a separate CLI command
$ npm run <command> $ npm run <command>

View File

@@ -4,34 +4,41 @@ about: Create a report to help us improve
title: '' title: ''
labels: 'Type: Bug' labels: 'Type: Bug'
assignees: '' assignees: ''
--- ---
**Describe the bug** **Describe the bug**
<!-- A clear and concise description of what the bug is. --> <!-- A clear and concise description of what the bug is. -->
**To Reproduce** **To Reproduce**
Steps to reproduce the behavior: Steps to reproduce the behavior:
1. Given this `redocly.yaml` file 1. Given this `redocly.yaml` file
2. And this OpenAPI file(s) 2. And this OpenAPI file(s)
3. Run this command with these arguments... `redocly ...` 3. Run this command with these arguments... `redocly ...`
4. See error 4. See error
**Expected behavior** **Expected behavior**
<!-- A clear and concise description of what you expected to happen. --> <!-- A clear and concise description of what you expected to happen. -->
**Logs** **Logs**
<!-- If applicable, add logs to help explain your problem. --> <!-- If applicable, add logs to help explain your problem. -->
**OpenAPI definition** **OpenAPI definition**
<!-- If applicable, add an OpenAPI definition and `.redocly.yaml` configuration file that helps reproduce the problem. <!-- If applicable, add an OpenAPI definition and `.redocly.yaml` configuration file that helps reproduce the problem.
At a minimum, please state the specification version(s) you're using (e.g. 2.0, 3.0, 3.1). --> At a minimum, please state the specification version(s) you're using (e.g. 2.0, 3.0, 3.1). -->
**Redocly Version(s)** **Redocly Version(s)**
<!-- What version of Redocly CLI are you using? --> <!-- What version of Redocly CLI are you using? -->
**`Node.js` Version(s)** **`Node.js` Version(s)**
<!-- What version of `node.js` are you using? --> <!-- What version of `node.js` are you using? -->
**Additional context** **Additional context**
<!-- Add any other context about the problem here. --> <!-- Add any other context about the problem here. -->

View File

@@ -4,17 +4,20 @@ about: Suggest an idea for this project
title: '' title: ''
labels: 'Type: Enhancement' labels: 'Type: Enhancement'
assignees: '' assignees: ''
--- ---
**Is your feature request related to a problem? Please describe.** **Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] --> <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
**Describe the solution you'd like** **Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. --> <!-- A clear and concise description of what you want to happen. -->
**Describe alternatives you've considered** **Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. --> <!-- A clear and concise description of any alternative solutions or features you've considered. -->
**Additional context** **Additional context**
<!-- Add any other context or screenshots about the feature request here. --> <!-- Add any other context or screenshots about the feature request here. -->

View File

@@ -3,3 +3,6 @@ dist/
packages/cli/lib/ packages/cli/lib/
packages/core/lib/ packages/core/lib/
*snapshot.js *snapshot.js
packages/core/src/rules/__tests__/fixtures/invalid-yaml.yaml
resources/output/invalid.json
__tests__/webpack-bundle/bundle-workflows/metafile.json

View File

@@ -1,3 +1 @@
{ { 'type': 'string' }
"type": "string"
}

View File

@@ -1,3 +1 @@
{ { 'type': 'string' }
"type": "string"
}

View File

@@ -1,3 +1 @@
{ { 'type': 'string' }
"type": "string"
}

View File

@@ -1,3 +1 @@
{ { 'type': 'string' }
"type": "string"
}

View File

@@ -1,3 +1 @@
{ { 'type': 'string' }
"type": "string"
}

View File

@@ -1,3 +1 @@
{ { 'type': 'string' }
"type": "string"
}

View File

@@ -17,7 +17,7 @@ paths:
get: get:
summary: Get user by ID summary: Get user by ID
responses: responses:
"200": '200':
description: OK description: OK
"404": '404':
description: Not found description: Not found

View File

@@ -24,7 +24,7 @@ paths:
x-private: true x-private: true
summary: Get an order by ID for a specific user summary: Get an order by ID for a specific user
responses: responses:
"200": '200':
description: OK description: OK
"404": '404':
description: Not found description: Not found

View File

@@ -17,7 +17,7 @@ paths:
get: get:
summary: Get user by ID summary: Get user by ID
responses: responses:
"200": '200':
description: OK description: OK
"404": '404':
description: Not found description: Not found

View File

@@ -24,7 +24,7 @@ paths:
x-private: true x-private: true
summary: Get an order by ID for a specific user summary: Get an order by ID for a specific user
responses: responses:
"200": '200':
description: OK description: OK
"404": '404':
description: Not found description: Not found

View File

@@ -6,7 +6,8 @@ openapi: 3.0.0
info: info:
version: 1.0.0 version: 1.0.0
title: Example OpenAPI 3 definition. title: Example OpenAPI 3 definition.
description: Test description from md file description: |
Test description from md file
license: license:
name: MIT name: MIT
url: https://opensource.org/licenses/MIT url: https://opensource.org/licenses/MIT

View File

@@ -8,14 +8,14 @@ servers:
paths: paths:
/users/{userId}/orders/{orderId}: /users/{userId}/orders/{orderId}:
parameters: parameters:
- $ref: "#/components/parameters/userIdParam" - $ref: '#/components/parameters/userIdParam'
- $ref: "#/components/parameters/orderIdParam" - $ref: '#/components/parameters/orderIdParam'
get: get:
summary: Get an order by ID for a specific user summary: Get an order by ID for a specific user
responses: responses:
"200": '200':
description: OK description: OK
"404": '404':
description: Not found description: Not found
components: components:
parameters: parameters:

View File

@@ -8,26 +8,26 @@ servers:
paths: paths:
/users/{userId}/products/{productId}: /users/{userId}/products/{productId}:
parameters: parameters:
- $ref: "#/components/parameters/userIdParam" - $ref: '#/components/parameters/userIdParam'
- $ref: "#/components/parameters/productIdParam" - $ref: '#/components/parameters/productIdParam'
get: get:
summary: Get a product by ID for a specific user summary: Get a product by ID for a specific user
responses: responses:
"200": '200':
description: OK description: OK
"404": '404':
description: Not found description: Not found
/users/{userId}/orders/{orderId}/items/{itemId}: /users/{userId}/orders/{orderId}/items/{itemId}:
parameters: parameters:
- $ref: "#/components/parameters/userIdParam" - $ref: '#/components/parameters/userIdParam'
- $ref: "#/components/parameters/orderIdParam" - $ref: '#/components/parameters/orderIdParam'
- $ref: "#/components/parameters/itemIdParam" - $ref: '#/components/parameters/itemIdParam'
get: get:
summary: Get an item by ID for a specific order and user summary: Get an item by ID for a specific order and user
responses: responses:
"200": '200':
description: OK description: OK
"404": '404':
description: Not found description: Not found
components: components:
parameters: parameters:

View File

@@ -19,8 +19,7 @@ paths:
description: string description: string
description: get Pet description description: get Pet description
servers: servers:
- url: - url: /pet
/pet
description: some description description: some description
get: get:
@@ -30,8 +29,7 @@ paths:
description: Returns a single pet description: Returns a single pet
operationId: getPetById operationId: getPetById
servers: servers:
- url: - url: /pet
/pet
parameters: parameters:
- name: petId - name: petId
in: path in: path

View File

@@ -17,10 +17,8 @@ paths:
- name: param2 - name: param2
in: header in: header
servers: servers:
- url: - url: /test
/test - url: /pets
- url:
/pets
description: another description description: another description
post: post:
tags: tags:
@@ -40,4 +38,3 @@ paths:
responses: responses:
'200': '200':
description: oka description: oka

View File

@@ -12,10 +12,11 @@ minLength assertion failed because the Schema didn't meet the assertions: Requir
31 | type: object 31 | type: object
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
32 | required: 32 | required:
| ^^^^^^^^^^ | ^^^^^^^^^
… | < 18 more lines > … | < 18 more lines >
51 | type: string 51 | type: string
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
52 |
Error was generated by the minLength assertion rule. Error was generated by the minLength assertion rule.
@@ -29,10 +30,11 @@ minLength assertion failed because the Schema didn't meet the assertions: Requir
46 | type: object 46 | type: object
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
47 | required: 47 | required:
| ^^^^^^^^^^ | ^^^^^^^^^
… | < 3 more lines > … | < 3 more lines >
51 | type: string 51 | type: string
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
52 |
Error was generated by the minLength assertion rule. Error was generated by the minLength assertion rule.

View File

@@ -5,17 +5,17 @@ info:
name: MIT name: MIT
url: example.com url: example.com
tags: tags:
- name: sometag - name: sometag
description: sometag description: sometag
servers: servers:
- url: https://example.com - url: https://example.com
security: [] security: []
paths: paths:
/someGet: /someGet:
get: get:
operationId: operationIdGet operationId: operationIdGet
parameters: parameters:
- $ref: "#/components/parameters/header_Accept" - $ref: '#/components/parameters/header_Accept'
responses: responses:
'200': '200':
description: '' description: ''

View File

@@ -26,8 +26,8 @@ paths:
summary: My resource summary: My resource
description: summary example description: summary example
externalDocs: externalDocs:
description: "Find more info here" description: 'Find more info here'
url: "https://example.com" url: 'https://example.com'
requestBody: requestBody:
content: content:
application/json: application/json:
@@ -80,4 +80,3 @@ paths:
- lang: 'C#' - lang: 'C#'
source: | source: |
PetStore.v1.Pet pet = new PetStore.v1.Pet(); PetStore.v1.Pet pet = new PetStore.v1.Pet();

View File

@@ -97,10 +97,10 @@ Every path item must have a GET operation.
| ^^^^ | ^^^^
25 | operationId: exampleOne 25 | operationId: exampleOne
| ^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^
… | < 57 more lines > … | < 56 more lines >
82 | PetStore.v1.Pet pet = new PetStore.v1.Pet();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 | 83 |
| ^
84 |
Error was generated by the path-item-get-defined assertion rule. Error was generated by the path-item-get-defined assertion rule.
@@ -128,7 +128,7 @@ anyType assertion failed because the any description didn't meet the assertions:
27 | description: summary example 27 | description: summary example
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
28 | externalDocs: 28 | externalDocs:
29 | description: "Find more info here" 29 | description: 'Find more info here'
Error was generated by the anyType assertion rule. Error was generated by the anyType assertion rule.
@@ -186,9 +186,9 @@ anyType assertion failed because the any description didn't meet the assertions:
27 | description: summary example 27 | description: summary example
28 | externalDocs: 28 | externalDocs:
29 | description: "Find more info here" 29 | description: 'Find more info here'
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
30 | url: "https://example.com" 30 | url: 'https://example.com'
31 | requestBody: 31 | requestBody:
Error was generated by the anyType assertion rule. Error was generated by the anyType assertion rule.
@@ -362,10 +362,10 @@ x-codeSamples must be defined
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
59 | summary: '' 59 | summary: ''
| ^^^^^^^^^^^ | ^^^^^^^^^^^
… | < 23 more lines > … | < 22 more lines >
82 | PetStore.v1.Pet pet = new PetStore.v1.Pet();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 | 83 |
| ^
84 |
Error was generated by the operation-x-code-samples-defined assertion rule. Error was generated by the operation-x-code-samples-defined assertion rule.
@@ -385,8 +385,6 @@ Did you mean: x-codeSamples instead of x-code-samples ?
82 | PetStore.v1.Pet pet = new PetStore.v1.Pet(); 82 | PetStore.v1.Pet pet = new PetStore.v1.Pet();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 | 83 |
| ^
84 |
Error was generated by the operation-x-code-samples-undefined assertion rule. Error was generated by the operation-x-code-samples-undefined assertion rule.

View File

@@ -30,7 +30,7 @@ paths:
parameters: parameters:
- name: Accept-Language - name: Accept-Language
in: header in: header
description: "The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US" description: 'The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US'
example: en-US example: en-US
required: false required: false
schema: schema:

View File

@@ -28,4 +28,3 @@ paths:
description: example description description: example description
'404': '404':
description: example description description: example description

View File

@@ -29,4 +29,3 @@ paths:
description: example description description: example description
'404': '404':
description: example description description: example description

View File

@@ -42,4 +42,3 @@ paths:
description: example description description: example description
'404': '404':
description: example description description: example description

View File

@@ -24,8 +24,8 @@ paths:
operationId: exampleOne operationId: exampleOne
summary: My resource summary: My resource
externalDocs: externalDocs:
description: "Find more info here" description: 'Find more info here'
url: "https://example.com" url: 'https://example.com'
requestBody: requestBody:
content: content:
application/json: application/json:
@@ -87,4 +87,3 @@ paths:
- lang: 'C#' - lang: 'C#'
source: | source: |
PetStore.v1.Pet pet = new PetStore.v1.Pet(); PetStore.v1.Pet pet = new PetStore.v1.Pet();

View File

@@ -6,7 +6,6 @@ info:
security: [] security: []
paths: paths:
/v1/pets/{petId}: /v1/pets/{petId}:
get: get:
operationId: getPet operationId: getPet
@@ -30,7 +29,6 @@ paths:
description: Internal Server Error. description: Internal Server Error.
components: components:
schemas: schemas:
Pet: Pet:
type: object type: object

View File

@@ -15,28 +15,29 @@ Servers must be present.
Error was generated by the no-empty-servers rule. Error was generated by the no-empty-servers rule.
[2] openapi.yaml:11:5 at #/paths/~1v1~1pets~1{petId}/get/summary [2] openapi.yaml:10:5 at #/paths/~1v1~1pets~1{petId}/get/summary
Operation object should contain \`summary\` field. Operation object should contain \`summary\` field.
9 | 8 | paths:
10 | /v1/pets/{petId}: 9 | /v1/pets/{petId}:
11 | get: 10 | get:
| ^^^ | ^^^
12 | operationId: getPet 11 | operationId: getPet
13 | parameters: 12 | parameters:
Error was generated by the operation-summary rule. Error was generated by the operation-summary rule.
[3] openapi.yaml:47:17 at #/components/schemas/Pet/properties/status/enum [3] openapi.yaml:45:17 at #/components/schemas/Pet/properties/status/enum
Expected type \`array\` but got \`string\`. Expected type \`array\` but got \`string\`.
45 | status: 43 | status:
46 | type: string 44 | type: string
47 | enum: string 45 | enum: string
| ^^^^^^ | ^^^^^^
46 |
Error was generated by the spec rule. Error was generated by the spec rule.

View File

@@ -16,7 +16,7 @@ paths:
- array - array
enum: enum:
- 1 - 1
- [ 1, 2, 3, string] - [1, 2, 3, string]
- 3 - 3
- string - string
/pong: /pong:

View File

@@ -7,7 +7,7 @@ validating /openapi.yaml...
Enum value \`string\` must be of allowed types: \`integer,array\`. Enum value \`string\` must be of allowed types: \`integer,array\`.
19 | - [ 1, 2, 3, string] 19 | - [1, 2, 3, string]
20 | - 3 20 | - 3
21 | - string 21 | - string
| ^^^^^^ | ^^^^^^

View File

@@ -16,7 +16,7 @@ paths:
- array - array
enum: enum:
- 1 - 1
- [ 1, 2, 3, string] - [1, 2, 3, string]
- 3 - 3
userId: userId:
application/json: application/json:

View File

@@ -8,14 +8,14 @@ info:
name: Apache 2.0 name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html url: http://www.apache.org/licenses/LICENSE-2.0.html
servers: servers:
- url: http://petstore.swagger.io/v1 - url: http://petstore.swagger.io/v1
security: [] security: []
components: components:
schemas: schemas:
Test: Test:
nullable: true nullable: true
paths: paths:
"/test": /test:
get: get:
summary: test summary: test
operationId: test operationId: test
@@ -25,7 +25,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Test" $ref: '#/components/schemas/Test'
example: {} example: {}
'400': '400':
description: An error response description: An error response

View File

@@ -12,7 +12,7 @@ The \`type\` field must be defined when the \`nullable\` field is used.
16 | nullable: true 16 | nullable: true
| ^^^^ | ^^^^
17 | paths: 17 | paths:
18 | "/test": 18 | /test:
Error was generated by the spec rule. Error was generated by the spec rule.
@@ -23,7 +23,7 @@ Example validation errored: "nullable" cannot be used without "type".
26 | application/json: 26 | application/json:
27 | schema: 27 | schema:
28 | $ref: "#/components/schemas/Test" 28 | $ref: '#/components/schemas/Test'
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29 | example: {} 29 | example: {}
30 | '400': 30 | '400':

View File

@@ -9,9 +9,11 @@
"url": "http://www.apache.org/licenses/LICENSE-2.0.html" "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
} }
}, },
"servers": [{ "servers": [
{
"url": "http://petstore.swagger.io/v1" "url": "http://petstore.swagger.io/v1"
}], }
],
"security": [], "security": [],
"paths": { "paths": {
"/test": { "/test": {
@@ -39,10 +41,7 @@
"schemas": { "schemas": {
"Pet": { "Pet": {
"type": "object", "type": "object",
"oneOf": [ "oneOf": [{ "$ref": "#/components/schemas/Pet" }, { "$ref": "#/components/schemas/Cat" }]
{ "$ref": "#/components/schemas/Pet" },
{ "$ref": "#/components/schemas/Cat" }
]
}, },
"Cat": { "Cat": {
"type": "object", "type": "object",

View File

@@ -10,9 +10,11 @@
} }
}, },
"security": [], "security": [],
"servers": [{ "servers": [
{
"url": "http://petstore.swagger.io/v1" "url": "http://petstore.swagger.io/v1"
}], }
],
"paths": { "paths": {
"/test": { "/test": {
"get": { "get": {
@@ -25,8 +27,7 @@
"application/json": { "application/json": {
"schema": { "$ref": "#/components/schemas/PetWithProps" }, "schema": { "$ref": "#/components/schemas/PetWithProps" },
"example": { "example": {
"a": { "a": {},
},
"b": { "b": {
"c": "hello" "c": "hello"
} }

View File

@@ -3,41 +3,39 @@
exports[`E2E lint no-invalid-media-type-examples-recursion 1`] = ` exports[`E2E lint no-invalid-media-type-examples-recursion 1`] = `
validating /openapi.json... validating /openapi.json...
[1] openapi.json:27:28 at #/paths/~1test/get/responses/202/content/application~1json/example [1] openapi.json:29:28 at #/paths/~1test/get/responses/202/content/application~1json/example
Example value must conform to the schema: must have required property 'c'. Example value must conform to the schema: must have required property 'c'.
25 | "application/json": { 27 | "application/json": {
26 | "schema": { "$ref": "#/components/schemas/PetWithProps" }, 28 | "schema": { "$ref": "#/components/schemas/PetWithProps" },
27 | "example": { 29 | "example": {
| ^
28 | "a": {
| ^^^^^^
… | < 4 more lines >
33 | }
| ^ | ^
30 | "a": {},
| ^^^^^^^^
… | < 3 more lines >
34 | } 34 | }
| ^
35 | } 35 | }
36 | }
referenced from openapi.json:25:35 at #/paths/~1test/get/responses/202/content/application~1json referenced from openapi.json:27:35 at #/paths/~1test/get/responses/202/content/application~1json
Warning was generated by the no-invalid-media-type-examples rule. Warning was generated by the no-invalid-media-type-examples rule.
[2] openapi.json:28:24 at #/paths/~1test/get/responses/202/content/application~1json/example/a [2] openapi.json:30:24 at #/paths/~1test/get/responses/202/content/application~1json/example/a
Example value must conform to the schema: \`a\` property must have required property 'c'. Example value must conform to the schema: \`a\` property must have required property 'c'.
26 | "schema": { "$ref": "#/components/schemas/PetWithProps" }, 28 | "schema": { "$ref": "#/components/schemas/PetWithProps" },
27 | "example": { 29 | "example": {
28 | "a": { 30 | "a": {},
| ^ | ^^
29 | }, 31 | "b": {
| ^ 32 | "c": "hello"
30 | "b": {
31 | "c": "hello"
referenced from openapi.json:25:35 at #/paths/~1test/get/responses/202/content/application~1json referenced from openapi.json:27:35 at #/paths/~1test/get/responses/202/content/application~1json
Warning was generated by the no-invalid-media-type-examples rule. Warning was generated by the no-invalid-media-type-examples rule.

View File

@@ -30,8 +30,7 @@ paths:
uniqueItems: true uniqueItems: true
items: items:
type: string type: string
example: example: test
test
responses: responses:
'200': '200':
description: My 200 response description: My 200 response

View File

@@ -3,16 +3,16 @@
exports[`E2E lint no-invalid-schema-examples-array-error 1`] = ` exports[`E2E lint no-invalid-schema-examples-array-error 1`] = `
validating /openapi.yaml... validating /openapi.yaml...
[1] openapi.yaml:34:21 at #/paths/~1my_post/post/requestBody/content/application~1json/schema/properties/my_list/example [1] openapi.yaml:33:28 at #/paths/~1my_post/post/requestBody/content/application~1json/schema/properties/my_list/example
Example value must conform to the schema: type must be array. Example value must conform to the schema: type must be array.
31 | items:
32 | type: string 32 | type: string
33 | example: 33 | example: test
34 | test
| ^^^^ | ^^^^
35 | responses: 34 | responses:
36 | '200': 35 | '200':
referenced from openapi.yaml:29:19 at #/paths/~1my_post/post/requestBody/content/application~1json/schema/properties/my_list referenced from openapi.yaml:29:19 at #/paths/~1my_post/post/requestBody/content/application~1json/schema/properties/my_list

View File

@@ -15,4 +15,3 @@ paths:
responses: responses:
'200': '200':
description: example description description: example description

View File

@@ -23,4 +23,3 @@ components:
format: int64 format: int64
name: name:
type: string type: string

View File

@@ -1,209 +1,209 @@
swagger: "2.0" swagger: '2.0'
info: info:
description: "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters." description: 'This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.'
version: "1.0.0" version: '1.0.0'
title: "Swagger Petstore" title: 'Swagger Petstore'
termsOfService: "http://swagger.io/terms/" termsOfService: 'http://swagger.io/terms/'
contact: contact:
email: "apiteam@swagger.io" email: 'apiteam@swagger.io'
license: license:
name: "Apache 2.0" name: 'Apache 2.0'
url: "http://www.apache.org/licenses/LICENSE-2.0.html" url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: "petstore.swagger.io" host: 'petstore.swagger.io'
basePath: "/v2" basePath: '/v2'
tags: tags:
- name: "pet" - name: 'pet'
description: "Everything about your Pets" description: 'Everything about your Pets'
externalDocs: externalDocs:
description: "Find out more" description: 'Find out more'
url: "http://swagger.io" url: 'http://swagger.io'
schemes: schemes:
- "http" - 'http'
security: [] security: []
paths: paths:
/pet: /pet:
post: post:
tags: tags:
- "pet" - 'pet'
summary: "Add a new pet to the store" summary: 'Add a new pet to the store'
description: "post a pet to store" description: 'post a pet to store'
operationId: "add_pet" operationId: 'add_pet'
consumes: consumes:
- "application/json" - 'application/json'
- "application/xml" - 'application/xml'
produces: produces:
- "application/xml" - 'application/xml'
- "application/json" - 'application/json'
parameters: parameters:
- in: "body" - in: 'body'
name: "body" name: 'body'
description: "Pet object that needs to be added to the store" description: 'Pet object that needs to be added to the store'
required: true required: true
schema: schema:
$ref: "#/definitions/Pet" $ref: '#/definitions/Pet'
responses: responses:
200: 200:
description: example description description: example description
405: 405:
description: "Invalid input" description: 'Invalid input'
security: security:
- petstore_auth: - petstore_auth:
- "write:pets" - 'write:pets'
- "read:pets" - 'read:pets'
put: put:
tags: tags:
- "pet" - 'pet'
summary: "Update an existing pet" summary: 'Update an existing pet'
description: "put new data for existing pet" description: 'put new data for existing pet'
operationId: "update_pet" operationId: 'update_pet'
consumes: consumes:
- "application/json" - 'application/json'
- "application/xml" - 'application/xml'
produces: produces:
- "application/xml" - 'application/xml'
- "application/json" - 'application/json'
parameters: parameters:
- in: "body" - in: 'body'
name: "body" name: 'body'
description: "Pet object that needs to be added to the store" description: 'Pet object that needs to be added to the store'
required: true required: true
schema: schema:
$ref: "#/definitions/Pet" $ref: '#/definitions/Pet'
responses: responses:
200: 200:
description: example description description: example description
400: 400:
description: "Invalid ID supplied" description: 'Invalid ID supplied'
404: 404:
description: "Pet not found" description: 'Pet not found'
405: 405:
description: "Validation exception" description: 'Validation exception'
security: security:
- petstore_auth: - petstore_auth:
- "write:pets" - 'write:pets'
- "read:pets" - 'read:pets'
/pet/find_by_status: /pet/find_by_status:
get: get:
tags: tags:
- "pet" - 'pet'
summary: "Finds Pets by status" summary: 'Finds Pets by status'
description: "Multiple status values can be provided with comma separated strings" description: 'Multiple status values can be provided with comma separated strings'
operationId: "list_pets_by_status" operationId: 'list_pets_by_status'
produces: produces:
- "application/xml" - 'application/xml'
- "application/json" - 'application/json'
parameters: parameters:
- name: "status" - name: 'status'
in: "query" in: 'query'
description: "Status values that need to be considered for filter" description: 'Status values that need to be considered for filter'
required: true required: true
type: "array" type: 'array'
items: items:
type: "string" type: 'string'
enum: enum:
- "available" - 'available'
- "pending" - 'pending'
- "sold" - 'sold'
default: "available" default: 'available'
collectionFormat: "multi" collectionFormat: 'multi'
responses: responses:
200: 200:
description: "successful operation" description: 'successful operation'
schema: schema:
$ref: "#/definitions/InlineResponse200" $ref: '#/definitions/InlineResponse200'
400: 400:
description: "Invalid status value" description: 'Invalid status value'
security: security:
- petstore_auth: - petstore_auth:
- "write:pets" - 'write:pets'
- "read:pets" - 'read:pets'
securityDefinitions: securityDefinitions:
petstore_auth: petstore_auth:
type: "oauth2" type: 'oauth2'
authorizationUrl: "http://petstore.swagger.io/oauth/dialog" authorizationUrl: 'http://petstore.swagger.io/oauth/dialog'
flow: "implicit" flow: 'implicit'
scopes: scopes:
write:pets: "modify pets in your account" write:pets: 'modify pets in your account'
read:pets: "read your pets" read:pets: 'read your pets'
definitions: definitions:
InlineResponse200: InlineResponse200:
type: "object" type: 'object'
description: "string" description: 'string'
properties: properties:
pets: pets:
type: "array" type: 'array'
description: "list of pets" description: 'list of pets'
items: items:
$ref: "#/definitions/Pet" $ref: '#/definitions/Pet'
Category: Category:
type: "object" type: 'object'
description: "string" description: 'string'
properties: properties:
id: id:
type: "integer" type: 'integer'
format: "int64" format: 'int64'
description: "string" description: 'string'
name: name:
type: "string" type: 'string'
description: "string" description: 'string'
xml: xml:
name: "Category" name: 'Category'
Tag: Tag:
type: "object" type: 'object'
description: "string" description: 'string'
properties: properties:
id: id:
type: "integer" type: 'integer'
format: "int64" format: 'int64'
description: "string" description: 'string'
name: name:
type: "string" type: 'string'
description: "string" description: 'string'
xml: xml:
name: "Tag" name: 'Tag'
Pet: Pet:
type: "object" type: 'object'
description: "string" description: 'string'
required: required:
- "name" - 'name'
- "photo_urls" - 'photo_urls'
properties: properties:
id: id:
type: "integer" type: 'integer'
format: "int64" format: 'int64'
description: "string" description: 'string'
category: category:
$ref: "#/definitions/Category" $ref: '#/definitions/Category'
name: name:
type: "string" type: 'string'
example: "doggie" example: 'doggie'
description: "string" description: 'string'
photo_urls: photo_urls:
type: "array" type: 'array'
description: "string" description: 'string'
xml: xml:
name: "photo_url" name: 'photo_url'
wrapped: true wrapped: true
items: items:
type: "string" type: 'string'
tags: tags:
type: "array" type: 'array'
description: "string" description: 'string'
pattern: "^http(s)?:\\/\\/([^\\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$" pattern: "^http(s)?:\\/\\/([^\\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$"
xml: xml:
name: "tag" name: 'tag'
wrapped: true wrapped: true
items: items:
$ref: "#/definitions/Tag" $ref: '#/definitions/Tag'
status: status:
type: "string" type: 'string'
description: "pet status in the store" description: 'pet status in the store'
enum: enum:
- "available" - 'available'
- "pending" - 'pending'
- "sold" - 'sold'
xml: xml:
name: "Pet" name: 'Pet'
externalDocs: externalDocs:
description: "Find out more about Swagger" description: 'Find out more about Swagger'
url: "http://swagger.io" url: 'http://swagger.io'

View File

@@ -1,4 +1,4 @@
openapi: "3.0.0" openapi: '3.0.0'
info: info:
version: 1.0.0 version: 1.0.0
title: Swagger Petstore title: Swagger Petstore
@@ -44,7 +44,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Pets" $ref: '#/components/schemas/Pets'
'400': '400':
description: An error response description: An error response
default: default:
@@ -52,7 +52,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
post: post:
summary: Create a pet summary: Create a pet
operationId: create_pets operationId: create_pets
@@ -68,7 +68,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
/pets/{pet_id}: /pets/{pet_id}:
get: get:
summary: Info for a specific pet summary: Info for a specific pet
@@ -88,7 +88,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Pets" $ref: '#/components/schemas/Pets'
'400': '400':
description: An error response description: An error response
default: default:
@@ -96,12 +96,11 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
components: components:
schemas: schemas:
Pet: Pet:
description: description: A pet
A pet
required: required:
- id - id
- name - name
@@ -109,16 +108,15 @@ components:
id: id:
type: integer type: integer
format: int64 format: int64
description: "id property" description: 'id property'
name: name:
type: string type: string
description: "name property" description: 'name property'
tag: tag:
type: string type: string
description: "tag property" description: 'tag property'
Pets: Pets:
description: description: A list of pets
A list of pets
required: required:
- pets - pets
- next_url - next_url
@@ -127,9 +125,9 @@ components:
properties: properties:
pets: pets:
type: array type: array
description: "object containing a list of pets" description: 'object containing a list of pets'
items: items:
$ref: "#/components/schemas/Pet" $ref: '#/components/schemas/Pet'
next_url: next_url:
type: string type: string
description: this is the url to next page description: this is the url to next page
@@ -146,8 +144,7 @@ components:
description: next token description: next token
Error: Error:
description: description: An error in processing a service request
An error in processing a service request
required: required:
- code - code
- message - message
@@ -155,7 +152,7 @@ components:
code: code:
type: integer type: integer
format: int32 format: int32
description: "code property" description: 'code property'
message: message:
type: string type: string
description: "message property" description: 'message property'

View File

@@ -28,13 +28,13 @@ paths:
summary: Get Test! Foo! Etc! summary: Get Test! Foo! Etc!
responses: responses:
200: 200:
description: "200" description: '200'
content: content:
application/json: application/json:
schema: schema:
type: array type: array
prefixItems: prefixItems:
- type: "string" - type: 'string'
items: false items: false
400: 400:
description: An error response description: An error response
@@ -56,7 +56,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Pets" $ref: '#/components/schemas/Pets'
'400': '400':
description: An error response description: An error response
/pets/model: /pets/model:
@@ -77,7 +77,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Model" $ref: '#/components/schemas/Model'
'400': '400':
description: An error response description: An error response
/pets/person: /pets/person:
@@ -98,7 +98,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/person" $ref: '#/components/schemas/person'
'400': '400':
description: An error response description: An error response
/: /:
@@ -151,7 +151,7 @@ webhooks:
contentEncoding: base64 contentEncoding: base64
contentMediaType: image/png contentMediaType: image/png
responses: responses:
"200": '200':
description: Return a 200 status to indicate that the data was received successfully description: Return a 200 status to indicate that the data was received successfully
'405': '405':
description: Invalid input description: Invalid input
@@ -165,7 +165,7 @@ webhooks:
content: content:
application/octet-stream: {} application/octet-stream: {}
responses: responses:
"200": '200':
description: Return a 200 status to indicate that the data was received successfully description: Return a 200 status to indicate that the data was received successfully
'400': '400':
description: An error response description: An error response
@@ -177,11 +177,11 @@ components:
pathItems: {} pathItems: {}
schemas: schemas:
Problem: Problem:
id: "https://tools.ietf.org/rfc/rfc7807.txt" id: 'https://tools.ietf.org/rfc/rfc7807.txt'
$schema: "http://json-schema.org/draft-06/schema#" $schema: 'http://json-schema.org/draft-06/schema#'
description: "schema for a rfc7807" description: 'schema for a rfc7807'
definitions: {} definitions: {}
type: "object" type: 'object'
properties: properties:
type: type:
description: A URI reference [RFC3986] that identifies the problem type. description: A URI reference [RFC3986] that identifies the problem type.
@@ -237,14 +237,14 @@ components:
type: array type: array
$comment: Array without items keyword $comment: Array without items keyword
either: either:
type: ['string','null'] type: ['string', 'null']
discriminator: discriminator:
propertyName: type propertyName: type
x-extension: true x-extension: true
Pets: Pets:
type: array type: array
items: items:
$ref: "#/components/schemas/Pet" $ref: '#/components/schemas/Pet'
Model: Model:
type: object type: object
properties: properties:
@@ -255,12 +255,12 @@ components:
- string - string
two: two:
description: type 'null' description: type 'null'
type: "null" type: 'null'
three: three:
description: type array including 'null' description: type array including 'null'
type: type:
- string - string
- "null" - 'null'
four: four:
description: array with no items description: array with no items
type: array type: array
@@ -285,7 +285,7 @@ components:
description: nullable string description: nullable string
type: type:
- string - string
- "null" - 'null'
eleven: eleven:
description: x-nullable string description: x-nullable string
type: type:

View File

@@ -11,8 +11,8 @@ Component: "Problem" is never used.
178 | schemas: 178 | schemas:
179 | Problem: 179 | Problem:
| ^^^^^^^ | ^^^^^^^
180 | id: "https://tools.ietf.org/rfc/rfc7807.txt" 180 | id: 'https://tools.ietf.org/rfc/rfc7807.txt'
181 | $schema: "http://json-schema.org/draft-06/schema#" 181 | $schema: 'http://json-schema.org/draft-06/schema#'
Warning was generated by the no-unused-components rule. Warning was generated by the no-unused-components rule.

View File

@@ -1,13 +1,13 @@
swagger: "2.0" swagger: '2.0'
info: info:
license: license:
name: MIT name: MIT
url: 'https://opensource.org/licenses/MIT' url: 'https://opensource.org/licenses/MIT'
title: "Swagger Petstore" title: 'Swagger Petstore'
description: "This is a sample" description: 'This is a sample'
version: "1.0.0" version: '1.0.0'
host: "petstore.swagger.io" host: 'petstore.swagger.io'
basePath: "/v2" basePath: '/v2'
securityDefinitions: securityDefinitions:
basicAuth: basicAuth:
type: basic type: basic
@@ -24,57 +24,57 @@ securityDefinitions:
testProp: test testProp: test
oauthImplicit: oauthImplicit:
type: oauth2 type: oauth2
authorizationUrl: "http://swagger.io/api/oauth/dialog" authorizationUrl: 'http://swagger.io/api/oauth/dialog'
flow: implicit flow: implicit
description: oauth implicit description: oauth implicit
tokenUrl: "http://tokenUrl" tokenUrl: 'http://tokenUrl'
scopes: scopes:
"write:pets": "modify pets in your account" 'write:pets': 'modify pets in your account'
"read:pets": "read your pets" 'read:pets': 'read your pets'
oauthAccessCode: oauthAccessCode:
type: oauth2 type: oauth2
flow: accessCode flow: accessCode
authorizationUrl: "http://swagger.io/api/oauth/dialog" authorizationUrl: 'http://swagger.io/api/oauth/dialog'
tokenUrl: "http://tokenUrl" tokenUrl: 'http://tokenUrl'
description: access code description: access code
name: accessCodeName name: accessCodeName
scopes: scopes:
"write:pets": "modify pets in your account" 'write:pets': 'modify pets in your account'
"read:pets": "read your pets" 'read:pets': 'read your pets'
oauthApplication: oauthApplication:
type: oauth2 type: oauth2
flow: application flow: application
authorizationUrl: "http://swagger.io/api/oauth/dialog" authorizationUrl: 'http://swagger.io/api/oauth/dialog'
tokenUrl: "http://tokenUrl" tokenUrl: 'http://tokenUrl'
description: oauth application description: oauth application
scopes: scopes:
"write:pets": "modify pets in your account" 'write:pets': 'modify pets in your account'
"read:pets": "read your pets" 'read:pets': 'read your pets'
oauthPassword: oauthPassword:
type: oauth2 type: oauth2
flow: password flow: password
authorizationUrl: "http://swagger.io/api/oauth/dialog" authorizationUrl: 'http://swagger.io/api/oauth/dialog'
tokenUrl: "http://tokenUrl" tokenUrl: 'http://tokenUrl'
description: oauth password description: oauth password
scopes: scopes:
"write:pets": "modify pets in your account" 'write:pets': 'modify pets in your account'
"read:pets": "read your pets" 'read:pets': 'read your pets'
paths: paths:
/pet: /pet:
get: get:
summary: "Add a new pet to the store" summary: 'Add a new pet to the store'
description: "" description: ''
operationId: "addPet" operationId: 'addPet'
consumes: consumes:
- "application/json" - 'application/json'
- "application/xml" - 'application/xml'
produces: produces:
- "application/xml" - 'application/xml'
- "application/json" - 'application/json'
responses: responses:
'201': '201':
description: Pet updated description: Pet updated
"405": '405':
description: "Invalid input" description: 'Invalid input'
security: security:
- basicAuth: [] - basicAuth: []

View File

@@ -53,10 +53,10 @@ The field \`tokenUrl\` is not allowed here.
28 | flow: implicit 28 | flow: implicit
29 | description: oauth implicit 29 | description: oauth implicit
30 | tokenUrl: "http://tokenUrl" 30 | tokenUrl: 'http://tokenUrl'
| ^^^^^^^^ | ^^^^^^^^
31 | scopes: 31 | scopes:
32 | "write:pets": "modify pets in your account" 32 | 'write:pets': 'modify pets in your account'
Error was generated by the spec rule. Error was generated by the spec rule.
@@ -65,12 +65,12 @@ Error was generated by the spec rule.
The field \`name\` is not allowed here. The field \`name\` is not allowed here.
38 | tokenUrl: "http://tokenUrl" 38 | tokenUrl: 'http://tokenUrl'
39 | description: access code 39 | description: access code
40 | name: accessCodeName 40 | name: accessCodeName
| ^^^^ | ^^^^
41 | scopes: 41 | scopes:
42 | "write:pets": "modify pets in your account" 42 | 'write:pets': 'modify pets in your account'
Error was generated by the spec rule. Error was generated by the spec rule.
@@ -81,9 +81,9 @@ The field \`authorizationUrl\` is not allowed here.
45 | type: oauth2 45 | type: oauth2
46 | flow: application 46 | flow: application
47 | authorizationUrl: "http://swagger.io/api/oauth/dialog" 47 | authorizationUrl: 'http://swagger.io/api/oauth/dialog'
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
48 | tokenUrl: "http://tokenUrl" 48 | tokenUrl: 'http://tokenUrl'
49 | description: oauth application 49 | description: oauth application
Error was generated by the spec rule. Error was generated by the spec rule.
@@ -95,9 +95,9 @@ The field \`authorizationUrl\` is not allowed here.
54 | type: oauth2 54 | type: oauth2
55 | flow: password 55 | flow: password
56 | authorizationUrl: "http://swagger.io/api/oauth/dialog" 56 | authorizationUrl: 'http://swagger.io/api/oauth/dialog'
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
57 | tokenUrl: "http://tokenUrl" 57 | tokenUrl: 'http://tokenUrl'
58 | description: oauth password 58 | description: oauth password
Error was generated by the spec rule. Error was generated by the spec rule.

View File

@@ -8,7 +8,7 @@ info:
url: https://opensource.org/licenses/MIT url: https://opensource.org/licenses/MIT
servers: servers:
- url: https://development.com/v1 - url: https://development.com/v1
paths: paths:
'/api/user/{}/profie': '/api/user/{}/profie':

View File

@@ -18,7 +18,7 @@ paths:
parameters: parameters:
- name: Accept-Language - name: Accept-Language
in: header in: header
description: "The language you prefer for messages" description: 'The language you prefer for messages'
example: en-US example: en-US
required: false required: false
schema: schema:

View File

@@ -18,7 +18,7 @@ paths:
parameters: parameters:
- name: Accept-Language - name: Accept-Language
in: header in: header
description: "The language you prefer for messages" description: 'The language you prefer for messages'
example: en-US example: en-US
required: false required: false
schema: schema:

View File

@@ -1,16 +1,16 @@
swagger: "2.0" swagger: '2.0'
info: info:
description: "This is a sample server Petstore server." description: 'This is a sample server Petstore server.'
version: "1.0.0" version: '1.0.0'
title: "Swagger Petstore" title: 'Swagger Petstore'
termsOfService: "http://swagger.io/terms/" termsOfService: 'http://swagger.io/terms/'
contact: contact:
email: "apiteam@swagger.io" email: 'apiteam@swagger.io'
license: license:
name: "Apache 2.0" name: 'Apache 2.0'
url: "http://www.apache.org/licenses/LICENSE-2.0.html" url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: "petstore.swagger.io" host: 'petstore.swagger.io'
basePath: "/v2" basePath: '/v2'
consumes: consumes:
- application/json - application/json
- multipart/form-data - multipart/form-data
@@ -18,50 +18,50 @@ produces:
- application/json - application/json
- application/xml - application/xml
tags: tags:
- name: "pet" - name: 'pet'
description: "Everything about your Pets" description: 'Everything about your Pets'
externalDocs: externalDocs:
description: "Find out more" description: 'Find out more'
url: "http://swagger.io" url: 'http://swagger.io'
schemes: schemes:
- "http" - 'http'
paths: paths:
/pet: /pet:
post: post:
tags: tags:
- "pet" - 'pet'
summary: "Add a new pet to the store" summary: 'Add a new pet to the store'
description: "post a pet to store" description: 'post a pet to store'
operationId: "add_pet" operationId: 'add_pet'
consumes: consumes:
- "application/xml" - 'application/xml'
produces: produces:
- "application/xml" - 'application/xml'
parameters: parameters:
- in: "body" - in: 'body'
name: "body" name: 'body'
description: "Pet object that needs to be added to the store" description: 'Pet object that needs to be added to the store'
required: true required: true
schema: schema:
$ref: "#/definitions/Pet" $ref: '#/definitions/Pet'
responses: responses:
200: 200:
description: example description description: example description
405: 405:
description: "Invalid input" description: 'Invalid input'
definitions: definitions:
Pet: Pet:
type: "object" type: 'object'
description: "string" description: 'string'
required: required:
- "name" - 'name'
- "photo_urls" - 'photo_urls'
properties: properties:
id: id:
type: "integer" type: 'integer'
format: "int64" format: 'int64'
description: "string" description: 'string'
name: name:
type: "string" type: 'string'
example: "doggie" example: 'doggie'
description: "string" description: 'string'

View File

@@ -7,12 +7,12 @@ validating /openapi.yaml...
Mime type "multipart/form-data" is not allowed Mime type "multipart/form-data" is not allowed
1 | swagger: "2.0" 1 | swagger: '2.0'
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
2 | info: 2 | info:
| ^^^^^ | ^^^^^
… | < 64 more lines > … | < 64 more lines >
67 | description: "string" 67 | description: 'string'
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
68 | 68 |
@@ -23,12 +23,12 @@ Error was generated by the request-mime-type rule.
Mime type "application/xml" is not allowed Mime type "application/xml" is not allowed
1 | swagger: "2.0" 1 | swagger: '2.0'
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
2 | info: 2 | info:
| ^^^^^ | ^^^^^
… | < 64 more lines > … | < 64 more lines >
67 | description: "string" 67 | description: 'string'
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
68 | 68 |
@@ -44,7 +44,7 @@ Mime type "application/xml" is not allowed
30 | post: 30 | post:
| ^^^^ | ^^^^
31 | tags: 31 | tags:
32 | - "pet" 32 | - 'pet'
Error was generated by the request-mime-type rule. Error was generated by the request-mime-type rule.
@@ -58,7 +58,7 @@ Mime type "application/xml" is not allowed
30 | post: 30 | post:
| ^^^^ | ^^^^
31 | tags: 31 | tags:
32 | - "pet" 32 | - 'pet'
Error was generated by the response-mime-type rule. Error was generated by the response-mime-type rule.

View File

@@ -86,7 +86,7 @@ x-webhooks:
type: string type: string
example: Guru example: Guru
responses: responses:
"200": '200':
description: Return a 200 status description: Return a 200 status
content: content:
application/xml: application/xml:

View File

@@ -49,4 +49,3 @@ paths:
properties: properties:
d: d:
type: string type: string

View File

@@ -10,4 +10,4 @@ components:
TestSchema: TestSchema:
title: TestSchema title: TestSchema
allOf: allOf:
- $ref: "#/components/requestBodies/TestRequestBody" - $ref: '#/components/requestBodies/TestRequestBody'

View File

@@ -12,8 +12,9 @@ The field \`paths\` must be present on this level.
2 | components: 2 | components:
| ^^^^^^^^^^^ | ^^^^^^^^^^^
… | < 10 more lines > … | < 10 more lines >
13 | - $ref: "#/components/requestBodies/TestRequestBody" 13 | - $ref: '#/components/requestBodies/TestRequestBody'
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 |
Error was generated by the spec rule. Error was generated by the spec rule.
@@ -27,8 +28,9 @@ The field \`info\` must be present on this level.
2 | components: 2 | components:
| ^^^^^^^^^^^ | ^^^^^^^^^^^
… | < 10 more lines > … | < 10 more lines >
13 | - $ref: "#/components/requestBodies/TestRequestBody" 13 | - $ref: '#/components/requestBodies/TestRequestBody'
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 |
Error was generated by the spec rule. Error was generated by the spec rule.

View File

@@ -1,45 +1,45 @@
swagger: "2.0" swagger: '2.0'
info: info:
version: "1.0.0" version: '1.0.0'
title: "Swagger Petstore" title: 'Swagger Petstore'
description: "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification" 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/" termsOfService: 'http://swagger.io/terms/'
contact: contact:
name: "Swagger API Team" name: 'Swagger API Team'
license: license:
name: "MIT" name: 'MIT'
host: "petstore.swagger.io" host: 'petstore.swagger.io'
basePath: "/api" basePath: '/api'
schemes: schemes:
- "http" - 'http'
consumes: consumes:
- "application/json" - 'application/json'
produces: produces:
- "application/json" - 'application/json'
paths: paths:
/pets: /pets:
get: get:
description: "Returns all pets from the system that the user has access to" description: 'Returns all pets from the system that the user has access to'
produces: produces:
- "application/json" - 'application/json'
responses: responses:
"200": '200':
description: "A list of pets." description: 'A list of pets.'
schema: schema:
type: "array" type: 'array'
items: items:
$ref: "#/definitions/Pet" $ref: '#/definitions/Pet'
definitions: definitions:
Pet: Pet:
type: "object" type: 'object'
required: required:
- "id" - 'id'
- "name" - 'name'
properties: properties:
id: id:
type: "integer" type: 'integer'
format: "int64" format: 'int64'
name: name:
type: "string" type: 'string'
tag: tag:
type: "string" type: 'string'

View File

@@ -1,4 +1,4 @@
openapi: "3.0.0" openapi: '3.0.0'
info: info:
version: 1.0.0 version: 1.0.0
title: Swagger Petstore title: Swagger Petstore
@@ -32,13 +32,13 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Pets" $ref: '#/components/schemas/Pets'
default: default:
description: unexpected error description: unexpected error
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
post: post:
summary: Create a pet summary: Create a pet
operationId: createPets operationId: createPets
@@ -52,7 +52,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
/pets/{petId}: /pets/{petId}:
get: get:
summary: Info for a specific pet summary: Info for a specific pet
@@ -72,13 +72,13 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Pet" $ref: '#/components/schemas/Pet'
default: default:
description: unexpected error description: unexpected error
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
components: components:
schemas: schemas:
Pet: Pet:
@@ -97,7 +97,7 @@ components:
Pets: Pets:
type: array type: array
items: items:
$ref: "#/components/schemas/Pet" $ref: '#/components/schemas/Pet'
Error: Error:
type: object type: object
required: required:

View File

@@ -1,4 +1,4 @@
openapi: "3.0.0" openapi: '3.0.0'
info: info:
version: 1.0.0 version: 1.0.0
title: Swagger Petstore title: Swagger Petstore
@@ -32,13 +32,13 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Pets" $ref: '#/components/schemas/Pets'
default: default:
description: unexpected error description: unexpected error
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
post: post:
summary: Create a pet summary: Create a pet
operationId: createPets operationId: createPets
@@ -52,7 +52,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
/pets/{petId}: /pets/{petId}:
get: get:
summary: Info for a specific pet summary: Info for a specific pet
@@ -72,13 +72,13 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Pet" $ref: '#/components/schemas/Pet'
default: default:
description: unexpected error description: unexpected error
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
components: components:
schemas: schemas:
Pet: Pet:
@@ -97,7 +97,7 @@ components:
Pets: Pets:
type: array type: array
items: items:
$ref: "#/components/schemas/Pet" $ref: '#/components/schemas/Pet'
Error: Error:
type: object type: object
required: required:

View File

@@ -4,7 +4,7 @@ description: >-
Lets you configure one or more API definition files. Lets you configure one or more API definition files.
This gives you the flexibility to reference specific files in commands, and configure each file at a granular level. This gives you the flexibility to reference specific files in commands, and configure each file at a granular level.
additionalProperties: additionalProperties:
x-additionalPropertiesName: "{name}@{version}" x-additionalPropertiesName: '{name}@{version}'
type: object type: object
title: API object title: API object
minItems: 1 minItems: 1

View File

@@ -43,7 +43,7 @@ properties:
Lets you configure one or more API definition files. Lets you configure one or more API definition files.
This gives you the flexibility to reference specific files in commands, and configure each file at a granular level. This gives you the flexibility to reference specific files in commands, and configure each file at a granular level.
additionalProperties: additionalProperties:
x-additionalPropertiesName: "{name}@{version}" x-additionalPropertiesName: '{name}@{version}'
type: object type: object
minItems: 1 minItems: 1
required: required:

View File

@@ -15,8 +15,8 @@
"coverage:core": "jest --roots packages/core/src --coverage", "coverage:core": "jest --roots packages/core/src --coverage",
"typecheck": "tsc --noEmit --skipLibCheck", "typecheck": "tsc --noEmit --skipLibCheck",
"e2e": "npm run webpack-bundle -- --mode=none && jest --roots=./__tests__/", "e2e": "npm run webpack-bundle -- --mode=none && jest --roots=./__tests__/",
"prettier": "npx prettier --write \"**/*.{ts,js}\"", "prettier": "npx prettier --write \"**/*.{ts,js,yaml,json}\"",
"prettier:check": "npx prettier --check \"**/*.{ts,js}\"", "prettier:check": "npx prettier --check \"**/*.{ts,js,yaml,json}\"",
"eslint": "eslint packages/**", "eslint": "eslint packages/**",
"clean": "rm -rf packages/**/lib packages/**/node_modules packages/**/*.tsbuildinfo package-lock.json node_modules", "clean": "rm -rf packages/**/lib packages/**/node_modules packages/**/*.tsbuildinfo package-lock.json node_modules",
"watch": "tsc -b tsconfig.build.json --watch ", "watch": "tsc -b tsconfig.build.json --watch ",

View File

@@ -60,10 +60,7 @@
"components": { "components": {
"schemas": { "schemas": {
"Pet": { "Pet": {
"required": [ "required": ["id", "name"],
"id",
"name"
],
"properties": { "properties": {
"id": { "id": {
"type": "integer", "type": "integer",

View File

@@ -1,7 +1,7 @@
openapi: "3.0.3" openapi: '3.0.3'
info: info:
title: bugtest title: bugtest
version: "1.0" version: '1.0'
description: Demo description: Demo
license: license:
name: DEMO name: DEMO
@@ -10,18 +10,18 @@ servers:
- url: http://demo.com/api - url: http://demo.com/api
paths: paths:
/customer: /customer:
summary: "Customer scope" summary: 'Customer scope'
get: get:
summary: "Get demo no refs" summary: 'Get demo no refs'
operationId: GetCustomer operationId: GetCustomer
description: "Returns Demo No Refs" description: 'Returns Demo No Refs'
responses: responses:
200: 200:
description: Demo No Refs description: Demo No Refs
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Customer" $ref: '#/components/schemas/Customer'
components: components:
schemas: schemas:
Customer: Customer:
@@ -32,4 +32,4 @@ components:
accounts: accounts:
type: array type: array
items: items:
$ref: "https://someexternal.schema" $ref: 'https://someexternal.schema'

View File

@@ -1,4 +1,4 @@
openapi: "3.0.1" openapi: '3.0.1'
info: info:
title: Open API title: Open API
description: Open API description: Open API

View File

@@ -5,6 +5,6 @@ allOf:
- integration_type - integration_type
properties: properties:
integration_type: integration_type:
$ref: "../openapi-with-back.yaml#/components/schemas/TypeB" $ref: '../openapi-with-back.yaml#/components/schemas/TypeB'
name: name:
type: string type: string

View File

@@ -374,7 +374,8 @@ describe('collect refs', () => {
Array [ Array [
"# Hello World "# Hello World
Lorem ipsum", Lorem ipsum
",
] ]
`); `);
}); });

View File

@@ -1567,7 +1567,7 @@ components:
allOf: allOf:
- $ref: '#/components/schemas/ResourceId' - $ref: '#/components/schemas/ResourceId'
name: name:
description: 'The tag''s unique name, which is case-insensitive.' description: "The tag's unique name, which is case-insensitive."
type: string type: string
maxLength: 255 maxLength: 255
pattern: '^[@~\-\.\w\s]+$' pattern: '^[@~\-\.\w\s]+$'
@@ -1628,10 +1628,10 @@ components:
type: object type: object
properties: properties:
medium: medium:
description: 'Lead Source''s medium (eg search, display)' description: "Lead Source's medium (eg search, display)"
type: string type: string
source: source:
description: 'Lead Source''s source (eg google, yahoo)' description: "Lead Source's source (eg google, yahoo)"
type: string type: string
campaign: campaign:
description: Lead Source's campaign (eg go-big-123) description: Lead Source's campaign (eg go-big-123)
@@ -1643,7 +1643,7 @@ components:
description: Lead Source's content (eg smiley faces) description: Lead Source's content (eg smiley faces)
type: string type: string
affiliate: affiliate:
description: 'Lead Source''s affiliate (eg 123, Bob Smith)' description: "Lead Source's affiliate (eg 123, Bob Smith)"
type: string type: string
subAffiliate: subAffiliate:
description: >- description: >-
@@ -2952,7 +2952,7 @@ components:
format: double format: double
example: 99.95 example: 99.95
maxQuantity: maxQuantity:
description: 'If the value is `null`, it''s assumed to be infinite.' description: "If the value is `null`, it's assumed to be infinite."
type: integer type: integer
example: 1 example: 1
stairstep: stairstep:
@@ -2995,7 +2995,7 @@ components:
type: object type: object
properties: properties:
price: price:
description: 'If the price is 0, it''s free.' description: "If the price is 0, it's free."
type: number type: number
format: double format: double
example: 99.95 example: 99.95
@@ -3047,7 +3047,7 @@ components:
type: object type: object
properties: properties:
price: price:
description: 'If the price is 0, it''s free.' description: "If the price is 0, it's free."
type: number type: number
format: double format: double
example: 99.95 example: 99.95
@@ -3099,7 +3099,7 @@ components:
type: object type: object
properties: properties:
price: price:
description: 'If the price is 0, it''s free.' description: "If the price is 0, it's free."
type: number type: number
format: double format: double
example: 99.95 example: 99.95
@@ -3724,7 +3724,7 @@ components:
readOnly: true readOnly: true
type: integer type: integer
subscriptionId: subscriptionId:
description: 'The related subscription''s ID if available, otherwise null.' description: "The related subscription's ID if available, otherwise null."
readOnly: true readOnly: true
allOf: allOf:
- $ref: '#/components/schemas/ResourceId' - $ref: '#/components/schemas/ResourceId'
@@ -4863,10 +4863,10 @@ components:
description: The gateway's response type description: The gateway's response type
type: string type: string
originalCode: originalCode:
description: 'The raw, unmapped gateway''s response code' description: "The raw, unmapped gateway's response code"
type: string type: string
originalMessage: originalMessage:
description: 'The raw, unmapped gateway''s response message' description: "The raw, unmapped gateway's response message"
type: string type: string
avsResponse: avsResponse:
description: The AVS gateway's response description: The AVS gateway's response
@@ -14948,7 +14948,7 @@ components:
description: The user mobile phone number description: The user mobile phone number
type: string type: string
password: password:
description: 'User''s password. If not provided, password reset email will be sent' description: "User's password. If not provided, password reset email will be sent"
type: string type: string
format: password format: password
permissions: permissions:

View File

@@ -1,2 +1,2 @@
rules: rules:
info-contact: warn info-contact: warn

View File

@@ -88,7 +88,7 @@ paths:
parameters: parameters:
- name: Accept-Language - name: Accept-Language
in: header in: header
description: "The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US" description: 'The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US'
example: en-US example: en-US
required: false required: false
schema: schema:
@@ -254,7 +254,7 @@ paths:
required: false required: false
schema: schema:
type: string type: string
example: "Bearer <TOKEN>" example: 'Bearer <TOKEN>'
- name: petId - name: petId
in: path in: path
description: Pet id to delete description: Pet id to delete
@@ -427,7 +427,7 @@ paths:
application/json: application/json:
example: example:
status: 400 status: 400
message: "Invalid Order" message: 'Invalid Order'
requestBody: requestBody:
content: content:
application/json: application/json:
@@ -1025,8 +1025,8 @@ components:
properties: properties:
id: id:
externalDocs: externalDocs:
description: "Find more info here" description: 'Find more info here'
url: "https://example.com" url: 'https://example.com'
description: Pet ID description: Pet ID
allOf: allOf:
- $ref: '#/components/schemas/Id' - $ref: '#/components/schemas/Id'
@@ -1199,7 +1199,7 @@ x-webhooks:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Pet" $ref: '#/components/schemas/Pet'
responses: responses:
"200": '200':
description: Return a 200 status to indicate that the data was received successfully description: Return a 200 status to indicate that the data was received successfully

View File

@@ -1,5 +1,4 @@
openapi: '3.0.0'
openapi: "3.0.0"
info: info:
version: 1.0.0 version: 1.0.0
title: Swagger Petstore title: Swagger Petstore
@@ -29,12 +28,12 @@ paths:
type: number type: number
example: example:
summary: A foo example summary: A foo example
value: {"foo": "bar"} value: { 'foo': 'bar' }
externalValue: 'http://example.org/foo.json' externalValue: 'http://example.org/foo.json'
examples: examples:
foo: foo:
summary: A foo example summary: A foo example
value: {"foo": "bar"} value: { 'foo': 'bar' }
externalValue: 'http://example.org/foo.json' externalValue: 'http://example.org/foo.json'
tags: tags:
- pets - pets
@@ -63,13 +62,13 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Pets" $ref: '#/components/schemas/Pets'
default: default:
description: unexpected error description: unexpected error
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
post: post:
summary: Create a pet summary: Create a pet
description: afasf description: afasf
@@ -84,7 +83,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
/pets/{petId}/TesSt: /pets/{petId}/TesSt:
get: get:
summary: Info for a specific pet summary: Info for a specific pet
@@ -105,13 +104,13 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Pet" $ref: '#/components/schemas/Pet'
default: default:
description: unexpected error description: unexpected error
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: '#/components/schemas/Error'
components: components:
parameters: parameters:
anotherParam: anotherParam:
@@ -142,7 +141,7 @@ components:
Pets: Pets:
type: array type: array
items: items:
$ref: "#/components/schemas/Pet" $ref: '#/components/schemas/Pet'
Error: Error:
type: object type: object
required: required: