Files
redocly-cli/__tests__/lint/assertions-error/snapshot.js

483 lines
12 KiB
JavaScript

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`E2E lint assertions-error 1`] = `
validating /openapi.yaml...
[1] openapi.yaml:10:16 at #/info/description
rule/anyType failed because the any description didn't meet the assertions: Should have at least 50 characters
8 | url: http://example.xyz
9 | title: Example OpenAPI 3 definition.
10 | description: Example description
| ^^^^^^^^^^^^^^^^^^^
11 | version: '1.0'
12 | contact:
Error was generated by the rule/anyType rule.
[2] openapi.yaml:18:18 at #/tags/0/description
rule/anyType failed because the any description didn't meet the assertions: Should have at least 50 characters
16 | tags:
17 | - name: test
18 | description: Description.
| ^^^^^^^^^^^^
19 | - name: about
20 | description: Everything about your Pets
Error was generated by the rule/anyType rule.
[3] openapi.yaml:18:18 at #/tags/0/description
Tag description must be at least 13 characters and end with a full stop.
16 | tags:
17 | - name: test
18 | description: Description.
| ^^^^^^^^^^^^
19 | - name: about
20 | description: Everything about your Pets
Error was generated by the rule/tag-description-pattern rule.
[4] openapi.yaml:20:18 at #/tags/1/description
rule/anyType failed because the any description didn't meet the assertions: Should have at least 50 characters
18 | description: Description.
19 | - name: about
20 | description: Everything about your Pets
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
21 | - name: Without description
22 | paths:
Error was generated by the rule/anyType rule.
[5] openapi.yaml:20:18 at #/tags/1/description
Tag description must be at least 13 characters and end with a full stop.
18 | description: Description.
19 | - name: about
20 | description: Everything about your Pets
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
21 | - name: Without description
22 | paths:
Error was generated by the rule/tag-description-pattern rule.
[6] openapi.yaml:21:5 at #/tags/2/description
Every tag must have a name and description.
19 | - name: about
20 | description: Everything about your Pets
21 | - name: Without description
| ^^^^^^^^^^^^^^^^^^^^^^^^^
22 | paths:
23 | /pet/findByStatus:
Error was generated by the rule/tag-name-and-desc rule.
[7] openapi.yaml:24:5 at #/paths/~1pet~1findByStatus/get
Every path item must have a GET operation.
22 | paths:
23 | /pet/findByStatus:
24 | put:
| ^^^^
25 | operationId: exampleOne
| ^^^^^^^^^^^^^^^^^^^^^^^
… | < 56 more lines >
82 | PetStore.v1.Pet pet = new PetStore.v1.Pet();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 |
Error was generated by the rule/path-item-get-defined rule.
[8] openapi.yaml:23:3 at #/paths/~1pet~1findByStatus
Every path item must have a GET(required) operation.
21 | - name: Without description
22 | paths:
23 | /pet/findByStatus:
| ^^^^^^^^^^^^^^^^^
24 | put:
25 | operationId: exampleOne
Error was generated by the rule/path-item-get-required rule.
[9] openapi.yaml:27:20 at #/paths/~1pet~1findByStatus/put/description
rule/anyType failed because the any description didn't meet the assertions: Should have at least 50 characters
25 | operationId: exampleOne
26 | summary: My resource
27 | description: summary example
| ^^^^^^^^^^^^^^^
28 | externalDocs:
29 | description: 'Find more info here'
Error was generated by the rule/anyType rule.
[10] openapi.yaml:24:5 at #/paths/~1pet~1findByStatus/put
Operation must not define both properties together: description and externalDocs
22 | paths:
23 | /pet/findByStatus:
24 | put:
| ^^^
25 | operationId: exampleOne
26 | summary: My resource
Error was generated by the rule/operation-mutually-exclusive rule.
[11] openapi.yaml:25:7 at #/paths/~1pet~1findByStatus/put/x-codeSamples
x-codeSamples must be defined
23 | /pet/findByStatus:
24 | put:
25 | operationId: exampleOne
| ^^^^^^^^^^^^^^^^^^^^^^^
26 | summary: My resource
| ^^^^^^^^^^^^^^^^^^^^
… | < 29 more lines >
56 | description: hooray
| ^^^^^^^^^^^^^^^^^^^
57 | post:
58 | operationId: EXAMPLE
Error was generated by the rule/operation-x-code-samples-defined rule.
[12] openapi.yaml:26:16 at #/paths/~1pet~1findByStatus/put/summary
Operation summary must have a maximum of 2 characters
24 | put:
25 | operationId: exampleOne
26 | summary: My resource
| ^^^^^^^^^^^
27 | description: summary example
28 | externalDocs:
Error was generated by the rule/operation-summary-max-length rule.
[13] openapi.yaml:29:22 at #/paths/~1pet~1findByStatus/put/externalDocs/description
rule/anyType failed because the any description didn't meet the assertions: Should have at least 50 characters
27 | description: summary example
28 | externalDocs:
29 | description: 'Find more info here'
| ^^^^^^^^^^^^^^^^^^^^^
30 | url: 'https://redocly-example.com'
31 | requestBody:
Error was generated by the rule/anyType rule.
[14] openapi.yaml:33:11 at #/paths/~1pet~1findByStatus/put/requestBody/content/application~1json
Only application/pdf can be used
31 | requestBody:
32 | content:
33 | application/json:
| ^^^^^^^^^^^^^^^^
34 | schema:
35 | type: 'object'
Error was generated by the rule/media-type-pdf rule.
[15] openapi.yaml:41:32 at #/paths/~1pet~1findByStatus/put/requestBody/content/application~1json/schema/properties/name/description
rule/anyType failed because the any description didn't meet the assertions: Should have at least 50 characters
39 | name:
40 | type: string
41 | description: hooray
| ^^^^^^
42 | responses:
43 | '404':
Error was generated by the rule/anyType rule.
[16] openapi.yaml:42:7 at #/paths/~1pet~1findByStatus/put/responses
Must mutually define 200 and 201 responses for PUT requests.
40 | type: string
41 | description: hooray
42 | responses:
| ^^^^^^^^^
43 | '404':
44 | description: summary example
Error was generated by the rule/operation-mutually-required-w-context rule.
[17] openapi.yaml:46:24 at #/paths/~1pet~1findByStatus/put/responses/201/description
rule/anyType failed because the any description didn't meet the assertions: Should have at least 50 characters
44 | description: summary example
45 | '201':
46 | description: summary example
| ^^^^^^^^^^^^^^^
47 | content:
48 | application/pdf:
Error was generated by the rule/anyType rule.
[18] openapi.yaml:51:17 at #/paths/~1pet~1findByStatus/put/responses/201/content/application~1pdf/schema/properties
The created_at and updated_at properties are mutually required
49 | schema:
50 | type: 'object'
51 | properties:
| ^^^^^^^^^^
52 | created_at:
53 | type: string
Error was generated by the rule/operation-mutually-required rule.
[19] openapi.yaml:56:34 at #/paths/~1pet~1findByStatus/put/responses/201/content/application~1pdf/schema/properties/name/description
rule/anyType failed because the any description didn't meet the assertions: Should have at least 50 characters
54 | name:
55 | type: string
56 | description: hooray
| ^^^^^^
57 | post:
58 | operationId: EXAMPLE
Error was generated by the rule/anyType rule.
[20] openapi.yaml:44:24 at #/paths/~1pet~1findByStatus/put/responses/404/description
rule/anyType failed because the any description didn't meet the assertions: Should have at least 50 characters
42 | responses:
43 | '404':
44 | description: summary example
| ^^^^^^^^^^^^^^^
45 | '201':
46 | description: summary example
Error was generated by the rule/anyType rule.
[21] openapi.yaml:59: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'
57 | post:
58 | operationId: EXAMPLE
59 | summary: ''
| ^^
60 | responses:
61 | '201':
Error was generated by the rule/operation-summary-suggest rule.
[22] openapi.yaml:59:16 at #/paths/~1pet~1findByStatus/post/summary
Summary should match a regex
57 | post:
58 | operationId: EXAMPLE
59 | summary: ''
| ^^
60 | responses:
61 | '201':
Error was generated by the rule/operation-summary-pattern rule.
[23] openapi.yaml:58:20 at #/paths/~1pet~1findByStatus/post/operationId
NamedExamples key must be in camelCase
56 | description: hooray
57 | post:
58 | operationId: EXAMPLE
| ^^^^^^^
59 | summary: ''
60 | responses:
Error was generated by the rule/operation-id-camel-case rule.
[24] openapi.yaml:79:7 at #/paths/~1pet~1findByStatus/post/x-code-samples
x-code-samples and x-internal must not be defined
77 | credit-file-identity-address:
78 | summary: Credit file with fallback
79 | x-code-samples:
| ^^^^^^^^^^^^^^
80 | - lang: 'C#'
81 | source: |
Error was generated by the rule/operation-disallowed rule.
[25] openapi.yaml:58:7 at #/paths/~1pet~1findByStatus/post/x-codeSamples
x-codeSamples must be defined
56 | description: hooray
57 | post:
58 | operationId: EXAMPLE
| ^^^^^^^^^^^^^^^^^^^^
59 | summary: ''
| ^^^^^^^^^^^
… | < 22 more lines >
82 | PetStore.v1.Pet pet = new PetStore.v1.Pet();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 |
Error was generated by the rule/operation-x-code-samples-defined rule.
[26] openapi.yaml:80:9 at #/paths/~1pet~1findByStatus/post/x-code-samples
x-code-samples is deprecated
Did you mean: x-codeSamples instead of x-code-samples ?
78 | summary: Credit file with fallback
79 | x-code-samples:
80 | - lang: 'C#'
| ^^^^^^^^^^^^
81 | source: |
| ^^^^^^^^^
82 | PetStore.v1.Pet pet = new PetStore.v1.Pet();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83 |
Error was generated by the rule/operation-x-code-samples-undefined rule.
[27] openapi.yaml:59:16 at #/paths/~1pet~1findByStatus/post/summary
Operation summary should not be empty
57 | post:
58 | operationId: EXAMPLE
59 | summary: ''
| ^^
60 | responses:
61 | '201':
Error was generated by the rule/operation-summary-non-empty rule.
[28] openapi.yaml:59:16 at #/paths/~1pet~1findByStatus/post/summary
Operation summary must have minimum of 2 chars length
57 | post:
58 | operationId: EXAMPLE
59 | summary: ''
| ^^
60 | responses:
61 | '201':
Error was generated by the rule/operation-summary-min-length rule.
[29] openapi.yaml:62:24 at #/paths/~1pet~1findByStatus/post/responses/201/description
rule/anyType failed because the any description didn't meet the assertions: Should have at least 50 characters
60 | responses:
61 | '201':
62 | description: Test description
| ^^^^^^^^^^^^^^^^
63 | content:
64 | application/pdf:
Error was generated by the rule/anyType rule.
[30] openapi.yaml:64:13 at #/paths/~1pet~1findByStatus/post/responses/201/content/application~1pdf
Media type should not be pdf
62 | description: Test description
63 | content:
64 | application/pdf:
| ^^^^^^^^^^^^^^^
65 | schema:
66 | type: 'object'
Error was generated by the rule/operation-w-context rule.
[31] openapi.yaml:71:24 at #/paths/~1pet~1findByStatus/post/responses/404/description
rule/anyType failed because the any description didn't meet the assertions: Should have at least 50 characters
69 | type: boolean
70 | '404':
71 | description: application/json
| ^^^^^^^^^^^^^^^^
72 | content:
73 | application/pdf:
Error was generated by the rule/anyType rule.
[32] openapi.yaml:77:17 at #/paths/~1pet~1findByStatus/post/responses/404/content/application~1pdf/examples/credit-file-identity-address
Examples names must use camelCase
75 | type: string
76 | examples:
77 | credit-file-identity-address:
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78 | summary: Credit file with fallback
79 | x-code-samples:
Error was generated by the rule/exampleMap rule.
/openapi.yaml: validated in <test>ms
❌ Validation failed with 32 errors.
run \`redocly lint --generate-ignore-file\` to add all problems to the ignore file.
`;