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.
## Pull Request Guidelines
Before submitting a pull request, please make sure the following is done:
1. Fork the repository and create your branch from `main`.
@@ -38,7 +39,7 @@ $ npm install # or npm i
### Commonly used NPM scripts
``` bash
```bash
# run a separate CLI command
$ npm run <command>

View File

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

View File

@@ -4,17 +4,20 @@ about: Suggest an idea for this project
title: ''
labels: 'Type: Enhancement'
assignees: ''
---
**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 [...] -->
**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->
**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->

View File

@@ -8,30 +8,30 @@ jobs:
if: ${{ github.event.label.name == 'deploy_s3_sandbox' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: node --version
- run: npm --version
- name: cache node modules
uses: actions/cache@v1
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-${{ hashFiles('package-lock.json') }}
npm-
- uses: actions/checkout@v3
- run: node --version
- run: npm --version
- name: cache node modules
uses: actions/cache@v1
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-${{ hashFiles('package-lock.json') }}
npm-
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
- name: Bundle into single file
run: npm run webpack-bundle
- name: Bundle into single file
run: npm run webpack-bundle
- name: Upload to AWS sandbox S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_SANDBOX_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SANDBOX_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: redocly-sandbox-openapi-cli-dist
- name: Upload to AWS sandbox S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_SANDBOX_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SANDBOX_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: redocly-sandbox-openapi-cli-dist

View File

@@ -10,60 +10,60 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm test
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm test
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- run: npm ci
- name: Bundle into single file
run: npm run webpack-bundle
- name: Bundle into single file
run: npm run webpack-bundle
- name: Upload to AWS S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: openapi-cli-dist
- name: Upload to AWS S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: openapi-cli-dist
- name: Upload to AWS sandbox S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_SANDBOX_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SANDBOX_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: redocly-sandbox-openapi-cli-dist
- name: Upload to AWS sandbox S3 bucket
run: npm run upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_SANDBOX_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SANDBOX_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
AWS_S3_PATH: redocly-sandbox-openapi-cli-dist
publish:
needs: [test, deploy]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm ci
- name: Publish to NPM
run: cd packages/core && npm publish && cd ../cli && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to NPM
run: cd packages/core && npm publish && cd ../cli && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
dockerhub:
needs: [publish]
runs-on: ubuntu-latest

View File

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

View File

@@ -12,14 +12,14 @@ paths:
main_data:
$anchor: main_data
type: object
properties:
properties:
foo:
type: string
type: object
oneOf:
- properties:
wrapper:
$ref: '#main_data'
- $ref: '#main_data'
example:
- properties:
wrapper:
$ref: '#main_data'
- $ref: '#main_data'
example:
foo: TEST

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:
summary: Get user by ID
responses:
"200":
'200':
description: OK
"404":
'404':
description: Not found

View File

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

View File

@@ -15,4 +15,4 @@ paths:
operationId: exampleBar
responses:
'201':
description: example description
description: example description

View File

@@ -16,4 +16,4 @@ paths:
format: int
responses:
'200':
description: example description
description: example description

View File

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

View File

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

View File

@@ -26,8 +26,8 @@ paths:
'/dog/{dogId}':
post:
tags:
- Dog
tags:
- Dog
summary: Dog example
operationId: exampleDogId
responses:

View File

@@ -1,7 +1,7 @@
openapi: 3.0.0
tags:
tags:
- name: Pet
description: Pet Discription
description: Pet Discription
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
@@ -18,4 +18,4 @@ paths:
operationId: exampleBar
responses:
'201':
description: example description
description: example description

View File

@@ -1,7 +1,7 @@
openapi: 3.0.0
tags:
tags:
- name: Pet
description: Pet Discription
description: Pet Discription
info:
version: 1.0.0
title: Example OpenAPI 3 definition.
@@ -26,4 +26,4 @@ paths:
format: int
responses:
'200':
description: example description
description: example description

View File

@@ -1,7 +1,7 @@
openapi: 3.0.0
tags:
tags:
- name: Pet
description: Pet Discription
description: Pet Discription
info:
version: 1.0.0
title: Example OpenAPI 3 definition with foo title.
@@ -26,4 +26,4 @@ paths:
format: int
responses:
'200':
description: example description
description: example description

View File

@@ -1 +1 @@
Test description from md file
Test description from md file

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
openapi: 3.0.0
tags:
tags:
- name: Pet
description: Another description
info:
@@ -18,4 +18,4 @@ paths:
operationId: exampleBar
responses:
'201':
description: example description
description: example description

View File

@@ -29,23 +29,23 @@ paths:
application/json:
schema:
type: object
required:
required:
- b
- a
- k
properties:
a:
type: string
b:
type: object
k:
k:
type: string
minLength: 2
c:
c:
type: object
required:
- k
properties:
required:
- k
properties:
k:
type: string
type: string

View File

@@ -11,11 +11,12 @@ minLength assertion failed because the Schema didn't meet the assertions: Requir
30 | schema:
31 | type: object
| ^^^^^^^^^^^^
32 | required:
| ^^^^^^^^^^
32 | required:
| ^^^^^^^^^
… | < 18 more lines >
51 | type: string
51 | type: string
| ^^^^^^^^^^^^
52 |
Error was generated by the minLength assertion rule.
@@ -25,14 +26,15 @@ Error was generated by the minLength assertion rule.
minLength assertion failed because the Schema didn't meet the assertions: Required property minLength inside k string property
44 | minLength: 2
45 | c:
45 | c:
46 | type: object
| ^^^^^^^^^^^^
47 | required:
| ^^^^^^^^^^
47 | required:
| ^^^^^^^^^
… | < 3 more lines >
51 | type: string
51 | type: string
| ^^^^^^^^^^^^
52 |
Error was generated by the minLength assertion rule.

View File

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

View File

@@ -26,8 +26,8 @@ paths:
summary: My resource
description: summary example
externalDocs:
description: "Find more info here"
url: "https://example.com"
description: 'Find more info here'
url: 'https://example.com'
requestBody:
content:
application/json:
@@ -80,4 +80,3 @@ paths:
- lang: 'C#'
source: |
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
| ^^^^^^^^^^^^^^^^^^^^^^^
… | < 57 more lines >
… | < 56 more lines >
82 | PetStore.v1.Pet pet = new PetStore.v1.Pet();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 |
| ^
84 |
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
| ^^^^^^^^^^^^^^^
28 | externalDocs:
29 | description: "Find more info here"
29 | description: 'Find more info here'
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
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:
Error was generated by the anyType assertion rule.
@@ -356,16 +356,16 @@ Error was generated by the operation-disallowed assertion rule.
x-codeSamples must be defined
56 | description: hooray
57 | post:
58 | operationId: EXAMPLE
| ^^^^^^^^^^^^^^^^^^^^
59 | summary: ''
| ^^^^^^^^^^^
… | < 23 more lines >
56 | description: hooray
57 | post:
58 | operationId: EXAMPLE
| ^^^^^^^^^^^^^^^^^^^^
59 | summary: ''
| ^^^^^^^^^^^
… | < 22 more lines >
82 | PetStore.v1.Pet pet = new PetStore.v1.Pet();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 |
| ^
84 |
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();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 |
| ^
84 |
Error was generated by the operation-x-code-samples-undefined assertion rule.

View File

@@ -27,10 +27,10 @@ paths:
operationId: list_pets
tags:
- pets
parameters:
parameters:
- name: Accept-Language
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
required: false
schema:

View File

@@ -18,7 +18,7 @@ paths:
get:
operationId: GetExampleId
summary: summary example
parameters:
parameters:
- name: statusId
in: query
- name: otherParam
@@ -28,4 +28,3 @@ paths:
description: example description
'404':
description: example description

View File

@@ -7,7 +7,7 @@ validating /openapi.yaml...
query-in-parameters assertion failed because the Parameter in didn't meet the assertions: query should be equal path
21 | parameters:
21 | parameters:
22 | - name: statusId
23 | in: query
| ^^^^^

View File

@@ -18,15 +18,14 @@ paths:
get:
operationId: GetExampleId
summary: summary example
parameters:
parameters:
- name: statusId
in: path
example: en-US
schema:
schema:
type: integer
responses:
'200':
description: example description
'404':
description: example description

View File

@@ -8,7 +8,7 @@ validating /openapi.yaml...
no-type-integer-in-parameter assertion failed because the Schema type didn't meet the assertions: "integer" should be one of the predefined values
24 | example: en-US
25 | schema:
25 | schema:
26 | type: integer
| ^^^^^^^
27 | responses:

View File

@@ -20,10 +20,10 @@ paths:
summary: summary example
responses:
'200':
content:
content:
application/json:
example: example
schema:
schema:
type: string
description: example description
'404':
@@ -34,12 +34,11 @@ paths:
summary: summary example
responses:
'200':
content:
content:
application/json:
example: example
schema:
schema:
type: integer
description: example description
'404':
description: example description

View File

@@ -1 +1 @@
Example description
Example description

View File

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

View File

@@ -6,16 +6,15 @@ info:
security: []
paths:
/v1/pets/{petId}:
get:
operationId: getPet
parameters:
- name: petId
in: path
required: true
schema:
type: string
- name: petId
in: path
required: true
schema:
type: string
responses:
'200':
description: Details of the requested pet.
@@ -26,16 +25,15 @@ paths:
'400':
description: Bad Request.
'500':
'500':
description: Internal Server Error.
components:
schemas:
Pet:
type: object
required:
- id
- id
properties:
name:
type: string
@@ -44,4 +42,4 @@ components:
format: uuid
status:
type: string
enum: string
enum: string

View File

@@ -15,28 +15,29 @@ Servers must be present.
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.
9 |
10 | /v1/pets/{petId}:
11 | get:
| ^^^
12 | operationId: getPet
13 | parameters:
8 | paths:
9 | /v1/pets/{petId}:
10 | get:
| ^^^
11 | operationId: getPet
12 | parameters:
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\`.
45 | status:
46 | type: string
47 | enum: string
43 | status:
44 | type: string
45 | enum: string
| ^^^^^^
46 |
Error was generated by the spec rule.

View File

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

View File

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

View File

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

View File

@@ -8,14 +8,14 @@ info:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: http://petstore.swagger.io/v1
- url: http://petstore.swagger.io/v1
security: []
components:
schemas:
Test:
nullable: true
paths:
"/test":
/test:
get:
summary: test
operationId: test
@@ -25,7 +25,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Test"
$ref: '#/components/schemas/Test'
example: {}
'400':
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
| ^^^^
17 | paths:
18 | "/test":
18 | /test:
Error was generated by the spec rule.
@@ -23,7 +23,7 @@ Example validation errored: "nullable" cannot be used without "type".
26 | application/json:
27 | schema:
28 | $ref: "#/components/schemas/Test"
28 | $ref: '#/components/schemas/Test'
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29 | example: {}
30 | '400':

View File

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

View File

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

View File

@@ -3,41 +3,39 @@
exports[`E2E lint no-invalid-media-type-examples-recursion 1`] = `
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'.
25 | "application/json": {
26 | "schema": { "$ref": "#/components/schemas/PetWithProps" },
27 | "example": {
27 | "application/json": {
28 | "schema": { "$ref": "#/components/schemas/PetWithProps" },
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.
[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'.
26 | "schema": { "$ref": "#/components/schemas/PetWithProps" },
27 | "example": {
28 | "a": {
| ^
29 | },
| ^
30 | "b": {
31 | "c": "hello"
28 | "schema": { "$ref": "#/components/schemas/PetWithProps" },
29 | "example": {
30 | "a": {},
| ^^
31 | "b": {
32 | "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.

View File

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

View File

@@ -3,16 +3,16 @@
exports[`E2E lint no-invalid-schema-examples-array-error 1`] = `
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.
31 | items:
32 | type: string
33 | example:
34 | test
| ^^^^
35 | responses:
36 | '200':
33 | example: test
| ^^^^
34 | responses:
35 | '200':
referenced from openapi.yaml:29:19 at #/paths/~1my_post/post/requestBody/content/application~1json/schema/properties/my_list

View File

@@ -8,8 +8,8 @@ servers:
id:
enum: []
placeId:
enum: [b]
default: a
enum: [b]
default: a
- url: https://example.com/{var}
variables: {}

View File

@@ -8,8 +8,8 @@ servers:
id:
enum: [c]
placeId:
enum: [b, a]
default: a
enum: [b, a]
default: a
- url: https://example.com/{var}
variables: {}

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
openapi: 3.0.0
info:
info:
paths:
/test:
get:

View File

@@ -8,7 +8,7 @@ validating /openapi.yaml...
Expected type \`Info\` (object) but got \`null\`
1 | openapi: 3.0.0
2 | info:
2 | info:
| ^^^^^
3 | paths:
4 | /test:

View File

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

View File

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

View File

@@ -17,7 +17,7 @@ servers:
variables:
var:
enum:
- a
- b
- a
- b
default: b
security: []

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
openapi: 3.1.0
info:
title: Example OpenAPI 3 definition.
title: Example OpenAPI 3 definition.
version: 1.0.0
paths:

View File

@@ -19,4 +19,4 @@ paths:
type:
type: string
title:
type: string
type: string

View File

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

View File

@@ -53,10 +53,10 @@ The field \`tokenUrl\` is not allowed here.
28 | flow: implicit
29 | description: oauth implicit
30 | tokenUrl: "http://tokenUrl"
30 | tokenUrl: 'http://tokenUrl'
| ^^^^^^^^
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.
@@ -65,12 +65,12 @@ Error was generated by the spec rule.
The field \`name\` is not allowed here.
38 | tokenUrl: "http://tokenUrl"
38 | tokenUrl: 'http://tokenUrl'
39 | description: access code
40 | name: accessCodeName
| ^^^^
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.
@@ -81,9 +81,9 @@ The field \`authorizationUrl\` is not allowed here.
45 | type: oauth2
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
Error was generated by the spec rule.
@@ -95,9 +95,9 @@ The field \`authorizationUrl\` is not allowed here.
54 | type: oauth2
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
Error was generated by the spec rule.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -29,24 +29,23 @@ paths:
application/json:
schema:
type: object
required:
required:
- b
- a
- k
properties:
a:
type: string
b:
type: object
k:
k:
type: string
minLength: 2
c:
c:
type: object
required:
- d
properties:
required:
- d
properties:
d:
type: string

View File

@@ -12,7 +12,7 @@ Property minLength is required.
37 | a:
| ^
38 | type: string
39 |
39 |
Error was generated by the required-string-property-missing-min-length rule.
@@ -21,12 +21,12 @@ Error was generated by the required-string-property-missing-min-length rule.
Property minLength is required.
48 | - d
49 | properties:
50 | d:
| ^
51 | type: string
52 |
48 | - d
49 | properties:
50 | d:
| ^
51 | type: string
52 |
Error was generated by the required-string-property-missing-min-length rule.

View File

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

View File

@@ -1,3 +1,3 @@
{
"openapi": "3.0.1"
}
}

View File

@@ -1,45 +1,45 @@
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"
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'

View File

@@ -1,4 +1,4 @@
openapi: "3.0.0"
openapi: '3.0.0'
info:
version: 1.0.0
title: Swagger Petstore
@@ -30,15 +30,15 @@ paths:
schema:
type: string
content:
application/json:
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
@@ -52,7 +52,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
$ref: '#/components/schemas/Error'
/pets/{petId}:
get:
summary: Info for a specific pet
@@ -72,13 +72,13 @@ paths:
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:
@@ -97,7 +97,7 @@ components:
Pets:
type: array
items:
$ref: "#/components/schemas/Pet"
$ref: '#/components/schemas/Pet'
Error:
type: object
required:
@@ -108,4 +108,4 @@ components:
type: integer
format: int32
message:
type: string
type: string

View File

@@ -1,4 +1,4 @@
openapi: "3.0.0"
openapi: '3.0.0'
info:
version: 1.0.0
title: Swagger Petstore
@@ -30,15 +30,15 @@ paths:
schema:
type: string
content:
application/json:
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
@@ -52,7 +52,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
$ref: '#/components/schemas/Error'
/pets/{petId}:
get:
summary: Info for a specific pet
@@ -72,13 +72,13 @@ paths:
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:
@@ -97,7 +97,7 @@ components:
Pets:
type: array
items:
$ref: "#/components/schemas/Pet"
$ref: '#/components/schemas/Pet'
Error:
type: object
required:
@@ -108,4 +108,4 @@ components:
type: integer
format: int32
message:
type: string
type: string

View File

@@ -4,7 +4,7 @@ description: >-
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.
additionalProperties:
x-additionalPropertiesName: "{name}@{version}"
x-additionalPropertiesName: '{name}@{version}'
type: object
title: API object
minItems: 1

View File

@@ -43,7 +43,7 @@ properties:
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.
additionalProperties:
x-additionalPropertiesName: "{name}@{version}"
x-additionalPropertiesName: '{name}@{version}'
type: object
minItems: 1
required:

View File

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

View File

@@ -67,4 +67,4 @@
}
}
}
}
}

View File

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

View File

@@ -1,3 +1,3 @@
$defs:
A:
type: string
type: string

View File

@@ -10,4 +10,4 @@ paths:
components:
schemas:
requestBody:
$ref: ./requestBody.yaml
$ref: ./requestBody.yaml

View File

@@ -1,35 +1,35 @@
openapi: 3.1.0
info:
title: My API
description: It ain't so wonderful, but at least it's mine.
version: '1.0'
contact:
email: me@theintenet.com
name: me
paths:
/test:
get:
summary: 'test'
responses:
200:
description: test
content:
application/json:
schema:
$ref: ./vendor.schema.yaml
components:
schemas:
vendor:
$ref: ./vendor.schema.yaml
myvendor:
$ref: ./vendor.schema.yaml
simple:
$ref: ./simple.yaml
A:
$ref: ./definitions.yaml#/$defs/A
test:
$ref: ./rename.yaml
rename:
type: string
rename-2:
$ref: ./rename.yaml
openapi: 3.1.0
info:
title: My API
description: It ain't so wonderful, but at least it's mine.
version: '1.0'
contact:
email: me@theintenet.com
name: me
paths:
/test:
get:
summary: 'test'
responses:
200:
description: test
content:
application/json:
schema:
$ref: ./vendor.schema.yaml
components:
schemas:
vendor:
$ref: ./vendor.schema.yaml
myvendor:
$ref: ./vendor.schema.yaml
simple:
$ref: ./simple.yaml
A:
$ref: ./definitions.yaml#/$defs/A
test:
$ref: ./rename.yaml
rename:
type: string
rename-2:
$ref: ./rename.yaml

View File

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

View File

@@ -18,4 +18,4 @@ components:
param-b:
name: param_b_alt
path-param:
name: path_param
name: path_param

View File

@@ -30,4 +30,4 @@ components:
name: path_param
examples:
first:
$ref: ./examples.yaml#/path-param/first
$ref: ./examples.yaml#/path-param/first

View File

@@ -1 +1 @@
type: number
type: number

View File

@@ -1,9 +1,9 @@
content:
application/json:
schema:
content:
application/json:
schema:
type: object
properties:
properties:
a:
type: string
b:
type: number
type: number

View File

@@ -1 +1 @@
type: string
type: string

View File

@@ -1 +1 @@
type: string
type: string

View File

@@ -1,20 +1,20 @@
title: vendor
type: object
description: Vendors
properties:
key:
type: string
description: System-assigned key for the vendor.
readOnly: true
id:
type: string
description: |
Unique identifier of the vendor.
You must specify a unique vendor ID when creating a vendor unless document sequencing is configured, in which case the ID is auto-generated.
name:
type: string
description: Name of the vendor.
isOneTimeUse:
type: boolean
description: One-time use
default: false
title: vendor
type: object
description: Vendors
properties:
key:
type: string
description: System-assigned key for the vendor.
readOnly: true
id:
type: string
description: |
Unique identifier of the vendor.
You must specify a unique vendor ID when creating a vendor unless document sequencing is configured, in which case the ID is auto-generated.
name:
type: string
description: Name of the vendor.
isOneTimeUse:
type: boolean
description: One-time use
default: false

Some files were not shown because too many files have changed in this diff Show More