mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 04:21:09 +00:00
345 lines
8.0 KiB
JavaScript
345 lines
8.0 KiB
JavaScript
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`E2E lint assertions-error 1`] = `
|
|
|
|
validating /openapi.yaml...
|
|
[1] openapi.yaml:17:18 at #/tags/0/description
|
|
|
|
Tag description must be at least 13 characters and end with a full stop.
|
|
|
|
15 | tags:
|
|
16 | - name: test
|
|
17 | description: Description.
|
|
| ^^^^^^^^^^^^
|
|
18 | - name: about
|
|
19 | description: Everything about your Pets
|
|
|
|
Error was generated by the tag-description-pattern assertion rule.
|
|
|
|
|
|
[2] openapi.yaml:19:18 at #/tags/1/description
|
|
|
|
Tag description must be at least 13 characters and end with a full stop.
|
|
|
|
17 | description: Description.
|
|
18 | - name: about
|
|
19 | description: Everything about your Pets
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
20 | - name: Without description
|
|
21 | paths:
|
|
|
|
Error was generated by the tag-description-pattern assertion rule.
|
|
|
|
|
|
[3] openapi.yaml:20:5 at #/tags/2/description
|
|
|
|
Every tag must have a name and description.
|
|
|
|
18 | - name: about
|
|
19 | description: Everything about your Pets
|
|
20 | - name: Without description
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
21 | paths:
|
|
22 | /pet/findByStatus:
|
|
|
|
Error was generated by the tag-name-and-desc assertion rule.
|
|
|
|
|
|
[4] openapi.yaml:23:5 at #/paths/~1pet~1findByStatus/get
|
|
|
|
Every path item must have a GET operation.
|
|
|
|
21 | paths:
|
|
22 | /pet/findByStatus:
|
|
23 | put:
|
|
| ^^^^
|
|
24 | operationId: exampleOne
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
… | < 57 more lines >
|
|
82 |
|
|
| ^
|
|
83 |
|
|
|
|
Error was generated by the path-item-get-defined assertion rule.
|
|
|
|
|
|
[5] openapi.yaml:22:3 at #/paths/~1pet~1findByStatus
|
|
|
|
Every path item must have a GET(required) operation.
|
|
|
|
20 | - name: Without description
|
|
21 | paths:
|
|
22 | /pet/findByStatus:
|
|
| ^^^^^^^^^^^^^^^^^
|
|
23 | put:
|
|
24 | operationId: exampleOne
|
|
|
|
Error was generated by the path-item-get-required assertion rule.
|
|
|
|
|
|
[6] openapi.yaml:23:5 at #/paths/~1pet~1findByStatus/put
|
|
|
|
Operation must not define both properties together: description and externalDocs
|
|
|
|
21 | paths:
|
|
22 | /pet/findByStatus:
|
|
23 | put:
|
|
| ^^^
|
|
24 | operationId: exampleOne
|
|
25 | summary: My resource
|
|
|
|
Error was generated by the operation-mutually-exclusive assertion rule.
|
|
|
|
|
|
[7] openapi.yaml:24:7 at #/paths/~1pet~1findByStatus/put/x-codeSamples
|
|
|
|
x-codeSamples must be defined
|
|
|
|
22 | /pet/findByStatus:
|
|
23 | put:
|
|
24 | operationId: exampleOne
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
25 | summary: My resource
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
… | < 29 more lines >
|
|
55 | description: hooray
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
56 | post:
|
|
57 | operationId: EXAMPLE
|
|
|
|
Error was generated by the operation-x-code-samples-defined assertion rule.
|
|
|
|
|
|
[8] openapi.yaml:25:16 at #/paths/~1pet~1findByStatus/put/summary
|
|
|
|
Operation summary must have a maximum of 2 characters
|
|
|
|
23 | put:
|
|
24 | operationId: exampleOne
|
|
25 | summary: My resource
|
|
| ^^^^^^^^^^^
|
|
26 | description: summary example
|
|
27 | externalDocs:
|
|
|
|
Error was generated by the operation-summary-max-length assertion rule.
|
|
|
|
|
|
[9] openapi.yaml:32:11 at #/paths/~1pet~1findByStatus/put/requestBody/content/application~1json
|
|
|
|
Only application/pdf can be used
|
|
|
|
30 | requestBody:
|
|
31 | content:
|
|
32 | application/json:
|
|
| ^^^^^^^^^^^^^^^^
|
|
33 | schema:
|
|
34 | type: 'object'
|
|
|
|
Error was generated by the media-type-pdf assertion rule.
|
|
|
|
|
|
[10] openapi.yaml:41:7 at #/paths/~1pet~1findByStatus/put/responses
|
|
|
|
Must mutually define 200 and 201 responses for PUT requests.
|
|
|
|
39 | type: string
|
|
40 | description: hooray
|
|
41 | responses:
|
|
| ^^^^^^^^^
|
|
42 | '404':
|
|
43 | description: summary example
|
|
|
|
Error was generated by the operation-mutually-required-w-context assertion rule.
|
|
|
|
|
|
[11] openapi.yaml:50:17 at #/paths/~1pet~1findByStatus/put/responses/201/content/application~1pdf/schema/properties
|
|
|
|
The created_at and updated_at properties are mutually required
|
|
|
|
48 | schema:
|
|
49 | type: 'object'
|
|
50 | properties:
|
|
| ^^^^^^^^^^
|
|
51 | created_at:
|
|
52 | type: string
|
|
|
|
Error was generated by the operation-mutually-required assertion rule.
|
|
|
|
|
|
[12] openapi.yaml:58:16 at #/paths/~1pet~1findByStatus/post/summary
|
|
|
|
Summary must be one of the predefined values
|
|
|
|
Did you mean:
|
|
- change to 'My resource'
|
|
- change to 'My collection'
|
|
|
|
56 | post:
|
|
57 | operationId: EXAMPLE
|
|
58 | summary: ''
|
|
| ^^
|
|
59 | responses:
|
|
60 | '201':
|
|
|
|
Error was generated by the operation-summary-suggest assertion rule.
|
|
|
|
|
|
[13] openapi.yaml:58:16 at #/paths/~1pet~1findByStatus/post/summary
|
|
|
|
Summary should match a regex
|
|
|
|
56 | post:
|
|
57 | operationId: EXAMPLE
|
|
58 | summary: ''
|
|
| ^^
|
|
59 | responses:
|
|
60 | '201':
|
|
|
|
Error was generated by the operation-summary-pattern assertion rule.
|
|
|
|
|
|
[14] openapi.yaml:57:20 at #/paths/~1pet~1findByStatus/post/operationId
|
|
|
|
NamedExamples key must be in PascalCase
|
|
|
|
55 | description: hooray
|
|
56 | post:
|
|
57 | operationId: EXAMPLE
|
|
| ^^^^^^^
|
|
58 | summary: ''
|
|
59 | responses:
|
|
|
|
Error was generated by the operation-id-camel-case assertion rule.
|
|
|
|
|
|
[15] openapi.yaml:78:7 at #/paths/~1pet~1findByStatus/post/x-code-samples
|
|
|
|
x-code-samples and x-internal must not be defined
|
|
|
|
76 | credit-file-identity-address:
|
|
77 | summary: Credit file with fallback
|
|
78 | x-code-samples:
|
|
| ^^^^^^^^^^^^^^
|
|
79 | - lang: 'C#'
|
|
80 | source: |
|
|
|
|
Error was generated by the operation-disallowed assertion rule.
|
|
|
|
|
|
[16] openapi.yaml:57:7 at #/paths/~1pet~1findByStatus/post/x-codeSamples
|
|
|
|
x-codeSamples must be defined
|
|
|
|
55 | description: hooray
|
|
56 | post:
|
|
57 | operationId: EXAMPLE
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
58 | summary: ''
|
|
| ^^^^^^^^^^^
|
|
… | < 23 more lines >
|
|
82 |
|
|
| ^
|
|
83 |
|
|
|
|
Error was generated by the operation-x-code-samples-defined assertion rule.
|
|
|
|
|
|
[17] openapi.yaml:79:9 at #/paths/~1pet~1findByStatus/post/x-code-samples
|
|
|
|
x-code-samples is deprecated
|
|
|
|
Did you mean: x-codeSamples instead of x-code-samples ?
|
|
|
|
77 | summary: Credit file with fallback
|
|
78 | x-code-samples:
|
|
79 | - lang: 'C#'
|
|
| ^^^^^^^^^^^^
|
|
80 | source: |
|
|
| ^^^^^^^^^
|
|
81 | PetStore.v1.Pet pet = new PetStore.v1.Pet();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
82 |
|
|
| ^
|
|
83 |
|
|
|
|
Error was generated by the operation-x-code-samples-undefined assertion rule.
|
|
|
|
|
|
[18] openapi.yaml:58:16 at #/paths/~1pet~1findByStatus/post/summary
|
|
|
|
Operation summary should not be empty
|
|
|
|
56 | post:
|
|
57 | operationId: EXAMPLE
|
|
58 | summary: ''
|
|
| ^^
|
|
59 | responses:
|
|
60 | '201':
|
|
|
|
Error was generated by the operation-summary-non-empty assertion rule.
|
|
|
|
|
|
[19] openapi.yaml:58:16 at #/paths/~1pet~1findByStatus/post/summary
|
|
|
|
Operation summary must have minimum of 2 chars length
|
|
|
|
56 | post:
|
|
57 | operationId: EXAMPLE
|
|
58 | summary: ''
|
|
| ^^
|
|
59 | responses:
|
|
60 | '201':
|
|
|
|
Error was generated by the operation-summary-min-length assertion rule.
|
|
|
|
|
|
[20] openapi.yaml:58:7 at #/paths/~1pet~1findByStatus/post/summary
|
|
|
|
Operation object \`summary\` must be non-empty string.
|
|
|
|
56 | post:
|
|
57 | operationId: EXAMPLE
|
|
58 | summary: ''
|
|
| ^^^^^^^
|
|
59 | responses:
|
|
60 | '201':
|
|
|
|
Error was generated by the operation-summary rule.
|
|
|
|
|
|
[21] openapi.yaml:63:13 at #/paths/~1pet~1findByStatus/post/responses/201/content/application~1pdf
|
|
|
|
Media type should not be pdf
|
|
|
|
61 | description: Test description
|
|
62 | content:
|
|
63 | application/pdf:
|
|
| ^^^^^^^^^^^^^^^
|
|
64 | schema:
|
|
65 | type: 'object'
|
|
|
|
Error was generated by the operation-w-context assertion rule.
|
|
|
|
|
|
[22] openapi.yaml:20:5 at #/tags/2/description
|
|
|
|
Tag object should contain \`description\` field.
|
|
|
|
18 | - name: about
|
|
19 | description: Everything about your Pets
|
|
20 | - name: Without description
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
21 | paths:
|
|
22 | /pet/findByStatus:
|
|
|
|
Warning was generated by the tag-description rule.
|
|
|
|
|
|
/openapi.yaml: validated in <test>ms
|
|
|
|
❌ Validation failed with 21 errors and 1 warning.
|
|
run \`openapi lint --generate-ignore-file\` to add all problems to the ignore file.
|
|
|
|
|
|
`;
|