@redocly/openapi-core 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/benchmark/benches/lint-with-many-rules.bench.js +4 -4
  3. package/lib/benchmark/benches/lint-with-nested-rule.bench.js +4 -4
  4. package/lib/benchmark/benches/lint-with-no-rules.bench.js +4 -4
  5. package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +4 -4
  6. package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +4 -4
  7. package/lib/benchmark/benches/recommended-oas3.bench.js +4 -4
  8. package/lib/benchmark/benches/resolve-with-no-external.bench.js +3 -3
  9. package/lib/benchmark/utils.js +3 -3
  10. package/lib/bundle.d.ts +4 -4
  11. package/lib/bundle.js +23 -23
  12. package/lib/config/all.d.ts +2 -2
  13. package/lib/config/all.js +44 -8
  14. package/lib/config/builtIn.js +2 -0
  15. package/lib/config/config-resolvers.js +25 -25
  16. package/lib/config/config.js +9 -9
  17. package/lib/config/index.js +5 -1
  18. package/lib/config/load.d.ts +1 -1
  19. package/lib/config/load.js +6 -6
  20. package/lib/config/minimal.d.ts +2 -2
  21. package/lib/config/minimal.js +34 -3
  22. package/lib/config/recommended-strict.d.ts +3 -0
  23. package/lib/config/recommended-strict.js +92 -0
  24. package/lib/config/recommended.d.ts +2 -2
  25. package/lib/config/recommended.js +34 -3
  26. package/lib/config/rules.d.ts +1 -1
  27. package/lib/config/types.d.ts +47 -46
  28. package/lib/config/types.js +2 -2
  29. package/lib/config/utils.js +26 -14
  30. package/lib/decorators/common/filters/filter-helper.js +4 -4
  31. package/lib/decorators/common/filters/filter-in.js +2 -2
  32. package/lib/decorators/common/filters/filter-out.js +2 -2
  33. package/lib/decorators/common/info-description-override.js +1 -1
  34. package/lib/decorators/common/media-type-examples-override.js +3 -3
  35. package/lib/decorators/common/operation-description-override.js +1 -1
  36. package/lib/decorators/common/registry-dependencies.js +1 -1
  37. package/lib/decorators/common/remove-x-internal.js +4 -4
  38. package/lib/decorators/common/tag-description-override.js +1 -1
  39. package/lib/format/codeframes.d.ts +6 -6
  40. package/lib/format/format.d.ts +2 -2
  41. package/lib/format/format.js +12 -12
  42. package/lib/js-yaml/index.d.ts +2 -2
  43. package/lib/js-yaml/index.js +2 -2
  44. package/lib/lint.js +18 -18
  45. package/lib/oas-types.d.ts +12 -10
  46. package/lib/oas-types.js +2 -2
  47. package/lib/redocly/index.js +10 -10
  48. package/lib/redocly/registry-api.js +2 -2
  49. package/lib/resolve.d.ts +4 -4
  50. package/lib/resolve.js +18 -18
  51. package/lib/rules/ajv.js +1 -1
  52. package/lib/rules/async2/index.d.ts +2 -11
  53. package/lib/rules/common/assertions/asserts.d.ts +3 -3
  54. package/lib/rules/common/assertions/asserts.js +21 -21
  55. package/lib/rules/common/assertions/index.d.ts +4 -4
  56. package/lib/rules/common/assertions/index.js +3 -3
  57. package/lib/rules/common/assertions/utils.d.ts +4 -4
  58. package/lib/rules/common/assertions/utils.js +3 -3
  59. package/lib/rules/common/info-contact.js +1 -1
  60. package/lib/rules/common/info-license-url.js +1 -1
  61. package/lib/rules/common/info-license.js +1 -1
  62. package/lib/rules/common/no-enum-type-mismatch.js +3 -3
  63. package/lib/rules/common/no-http-verbs-in-paths.js +2 -2
  64. package/lib/rules/common/no-invalid-parameter-examples.js +3 -3
  65. package/lib/rules/common/no-invalid-schema-examples.js +3 -3
  66. package/lib/rules/common/operation-2xx-response.js +2 -2
  67. package/lib/rules/common/operation-4xx-response.js +2 -2
  68. package/lib/rules/common/operation-description.js +1 -1
  69. package/lib/rules/common/operation-operationId.js +1 -1
  70. package/lib/rules/common/operation-summary.js +1 -1
  71. package/lib/rules/common/path-segment-plural.js +1 -1
  72. package/lib/rules/common/response-contains-header.js +2 -2
  73. package/lib/rules/common/spec-strict-refs.js +1 -1
  74. package/lib/rules/common/spec.js +11 -11
  75. package/lib/rules/common/tag-description.js +1 -1
  76. package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +1 -1
  77. package/lib/rules/oas2/index.d.ts +2 -46
  78. package/lib/rules/oas2/remove-unused-components.js +1 -1
  79. package/lib/rules/oas2/request-mime-type.js +2 -2
  80. package/lib/rules/oas2/response-contains-property.js +2 -2
  81. package/lib/rules/oas2/response-mime-type.js +2 -2
  82. package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +1 -1
  83. package/lib/rules/oas3/index.d.ts +1 -1
  84. package/lib/rules/oas3/index.js +1 -1
  85. package/lib/rules/oas3/no-invalid-media-type-examples.js +3 -3
  86. package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +3 -3
  87. package/lib/rules/oas3/remove-unused-components.js +2 -2
  88. package/lib/rules/oas3/request-mime-type.js +3 -3
  89. package/lib/rules/oas3/response-contains-property.js +2 -2
  90. package/lib/rules/oas3/response-mime-type.js +3 -3
  91. package/lib/rules/utils.js +3 -3
  92. package/lib/types/asyncapi.js +21 -21
  93. package/lib/types/index.d.ts +8 -8
  94. package/lib/types/oas2.js +14 -14
  95. package/lib/types/oas3.js +27 -27
  96. package/lib/types/oas3_1.js +6 -6
  97. package/lib/types/redocly-yaml.d.ts +11 -0
  98. package/lib/types/redocly-yaml.js +71 -53
  99. package/lib/types/theme-config.js +1 -1
  100. package/lib/typings/common.d.ts +2 -2
  101. package/lib/typings/openapi.d.ts +6 -6
  102. package/lib/typings/swagger.d.ts +3 -3
  103. package/lib/utils.d.ts +5 -5
  104. package/lib/utils.js +3 -3
  105. package/lib/visitors.d.ts +40 -40
  106. package/lib/walk.d.ts +14 -15
  107. package/lib/walk.js +11 -11
  108. package/package.json +2 -2
  109. package/src/__tests__/lint.test.ts +40 -40
  110. package/src/__tests__/normalizeVisitors.test.ts +23 -5
  111. package/src/__tests__/ref-utils.test.ts +7 -7
  112. package/src/__tests__/resolve-http.test.ts +10 -10
  113. package/src/__tests__/resolve.test.ts +39 -39
  114. package/src/__tests__/walk.test.ts +48 -48
  115. package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +95 -32
  116. package/src/config/__tests__/__snapshots__/config.test.ts.snap +81 -81
  117. package/src/config/__tests__/config-resolvers.test.ts +30 -1
  118. package/src/config/__tests__/config.test.ts +88 -88
  119. package/src/config/__tests__/load.test.ts +12 -8
  120. package/src/config/__tests__/utils.test.ts +18 -18
  121. package/src/config/all.ts +46 -9
  122. package/src/config/builtIn.ts +2 -0
  123. package/src/config/minimal.ts +36 -4
  124. package/src/config/recommended-strict.ts +93 -0
  125. package/src/config/recommended.ts +36 -4
  126. package/src/config/types.ts +22 -8
  127. package/src/config/utils.ts +15 -0
  128. package/src/decorators/common/media-type-examples-override.ts +2 -2
  129. package/src/lint.ts +3 -3
  130. package/src/oas-types.ts +26 -3
  131. package/src/rules/__tests__/no-unresolved-refs.test.ts +26 -26
  132. package/src/rules/async2/__tests__/channels-kebab-case.test.ts +12 -12
  133. package/src/rules/async2/__tests__/no-channel-trailing-slash.test.ts +7 -7
  134. package/src/rules/async2/index.ts +2 -1
  135. package/src/rules/common/__tests__/info-license.test.ts +6 -6
  136. package/src/rules/common/__tests__/license-url.test.ts +6 -6
  137. package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +13 -13
  138. package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +18 -18
  139. package/src/rules/common/__tests__/no-identical-paths.test.ts +5 -5
  140. package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +12 -12
  141. package/src/rules/common/__tests__/operation-2xx-response.test.ts +18 -18
  142. package/src/rules/common/__tests__/operation-4xx-response.test.ts +23 -23
  143. package/src/rules/common/__tests__/operation-operationId-unique.test.ts +6 -6
  144. package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +5 -5
  145. package/src/rules/common/__tests__/operation-parameters-unique.test.ts +16 -16
  146. package/src/rules/common/__tests__/operation-singular-tag.test.ts +6 -6
  147. package/src/rules/common/__tests__/path-http-verbs-order.test.ts +10 -10
  148. package/src/rules/common/__tests__/path-not-include-query.test.ts +6 -6
  149. package/src/rules/common/__tests__/path-params-defined.test.ts +21 -21
  150. package/src/rules/common/__tests__/paths-kebab-case.test.ts +11 -11
  151. package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +18 -18
  152. package/src/rules/common/__tests__/security-defined.test.ts +21 -21
  153. package/src/rules/common/__tests__/spec-strict-refs.test.ts +9 -9
  154. package/src/rules/common/__tests__/spec.test.ts +102 -102
  155. package/src/rules/common/__tests__/tag-description.test.ts +6 -6
  156. package/src/rules/common/__tests__/tags-alphabetical.test.ts +12 -12
  157. package/src/rules/common/assertions/__tests__/index.test.ts +15 -15
  158. package/src/rules/common/assertions/__tests__/utils.test.ts +9 -9
  159. package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +7 -7
  160. package/src/rules/oas2/__tests__/response-contains-header.test.ts +13 -13
  161. package/src/rules/oas2/__tests__/response-contains-property.test.ts +8 -8
  162. package/src/rules/oas2/__tests__/spec/info.test.ts +21 -21
  163. package/src/rules/oas2/__tests__/spec/operation.test.ts +4 -4
  164. package/src/rules/oas2/__tests__/spec/paths.test.ts +12 -12
  165. package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +1 -1
  166. package/src/rules/oas2/index.ts +3 -1
  167. package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +7 -7
  168. package/src/rules/oas3/__tests__/component-name-unique.test.ts +186 -186
  169. package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +18 -18
  170. package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +6 -6
  171. package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +36 -36
  172. package/src/rules/oas3/__tests__/no-server-example.com.test.ts +11 -11
  173. package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +7 -7
  174. package/src/rules/oas3/__tests__/no-unused-components.test.ts +31 -31
  175. package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +15 -15
  176. package/src/rules/oas3/__tests__/response-contains-header.test.ts +26 -26
  177. package/src/rules/oas3/__tests__/response-contains-property.test.ts +27 -27
  178. package/src/rules/oas3/__tests__/spec/callbacks.test.ts +1 -1
  179. package/src/rules/oas3/__tests__/spec/info.test.ts +21 -21
  180. package/src/rules/oas3/__tests__/spec/operation.test.ts +10 -10
  181. package/src/rules/oas3/__tests__/spec/paths.test.ts +13 -13
  182. package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +2 -2
  183. package/src/rules/oas3/__tests__/spec/servers.test.ts +25 -25
  184. package/src/rules/oas3/__tests__/spec/spec.test.ts +56 -56
  185. package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +28 -28
  186. package/src/rules/oas3/index.ts +3 -3
  187. package/src/types/redocly-yaml.ts +75 -40
  188. package/src/visitors.ts +3 -3
  189. package/src/walk.ts +23 -10
  190. package/tsconfig.tsbuildinfo +1 -1
@@ -37,14 +37,14 @@ describe('no-invalid-media-type-examples', () => {
37
37
  });
38
38
 
39
39
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
40
- Array [
41
- Object {
42
- "from": Object {
40
+ [
41
+ {
42
+ "from": {
43
43
  "pointer": "#/paths/~1pet/get/responses/200/content/application~1json",
44
44
  "source": "foobar.yaml",
45
45
  },
46
- "location": Array [
47
- Object {
46
+ "location": [
47
+ {
48
48
  "pointer": "#/paths/~1pet/get/responses/200/content/application~1json/example/a",
49
49
  "reportOnKey": false,
50
50
  "source": "foobar.yaml",
@@ -53,15 +53,15 @@ describe('no-invalid-media-type-examples', () => {
53
53
  "message": "Example value must conform to the schema: \`a\` property type must be string.",
54
54
  "ruleId": "no-invalid-media-type-examples",
55
55
  "severity": "error",
56
- "suggest": Array [],
56
+ "suggest": [],
57
57
  },
58
- Object {
59
- "from": Object {
58
+ {
59
+ "from": {
60
60
  "pointer": "#/paths/~1pet/get/responses/200/content/application~1json",
61
61
  "source": "foobar.yaml",
62
62
  },
63
- "location": Array [
64
- Object {
63
+ "location": [
64
+ {
65
65
  "pointer": "#/paths/~1pet/get/responses/200/content/application~1json/example/b",
66
66
  "reportOnKey": false,
67
67
  "source": "foobar.yaml",
@@ -70,7 +70,7 @@ describe('no-invalid-media-type-examples', () => {
70
70
  "message": "Example value must conform to the schema: \`b\` property type must be number.",
71
71
  "ruleId": "no-invalid-media-type-examples",
72
72
  "severity": "error",
73
- "suggest": Array [],
73
+ "suggest": [],
74
74
  },
75
75
  ]
76
76
  `);
@@ -115,14 +115,14 @@ describe('no-invalid-media-type-examples', () => {
115
115
  });
116
116
 
117
117
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
118
- Array [
119
- Object {
120
- "from": Object {
118
+ [
119
+ {
120
+ "from": {
121
121
  "pointer": "#/paths/~1pet/get/responses/200/content/application~1json",
122
122
  "source": "foobar.yaml",
123
123
  },
124
- "location": Array [
125
- Object {
124
+ "location": [
125
+ {
126
126
  "pointer": "#/paths/~1pet/get/responses/200/content/application~1json/example/c",
127
127
  "reportOnKey": true,
128
128
  "source": "foobar.yaml",
@@ -131,7 +131,7 @@ describe('no-invalid-media-type-examples', () => {
131
131
  "message": "Example value must conform to the schema: must NOT have unevaluated properties \`c\`.",
132
132
  "ruleId": "no-invalid-media-type-examples",
133
133
  "severity": "error",
134
- "suggest": Array [],
134
+ "suggest": [],
135
135
  },
136
136
  ]
137
137
  `);
@@ -174,7 +174,7 @@ describe('no-invalid-media-type-examples', () => {
174
174
  }),
175
175
  });
176
176
 
177
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
177
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
178
178
  });
179
179
 
180
180
  it('should not report on valid example with allowAdditionalProperties and allOf and $ref', async () => {
@@ -223,7 +223,7 @@ describe('no-invalid-media-type-examples', () => {
223
223
  }),
224
224
  });
225
225
 
226
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
226
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
227
227
  });
228
228
 
229
229
  it('should not on invalid examples', async () => {
@@ -274,14 +274,14 @@ describe('no-invalid-media-type-examples', () => {
274
274
  });
275
275
 
276
276
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
277
- Array [
278
- Object {
279
- "from": Object {
277
+ [
278
+ {
279
+ "from": {
280
280
  "pointer": "#/paths/~1pet/get/responses/200/content/application~1json",
281
281
  "source": "foobar.yaml",
282
282
  },
283
- "location": Array [
284
- Object {
283
+ "location": [
284
+ {
285
285
  "pointer": "#/components/examples/test/value/a",
286
286
  "reportOnKey": false,
287
287
  "source": "foobar.yaml",
@@ -290,7 +290,7 @@ describe('no-invalid-media-type-examples', () => {
290
290
  "message": "Example value must conform to the schema: \`a\` property type must be string.",
291
291
  "ruleId": "no-invalid-media-type-examples",
292
292
  "severity": "error",
293
- "suggest": Array [],
293
+ "suggest": [],
294
294
  },
295
295
  ]
296
296
  `);
@@ -321,7 +321,7 @@ describe('no-invalid-media-type-examples', () => {
321
321
  config: await makeConfig({ 'no-invalid-media-type-examples': 'error' }),
322
322
  });
323
323
 
324
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
324
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
325
325
  });
326
326
 
327
327
  it('should not report if no schema', async () => {
@@ -353,7 +353,7 @@ describe('no-invalid-media-type-examples', () => {
353
353
  config: await makeConfig({ 'no-invalid-media-type-examples': 'error' }),
354
354
  });
355
355
 
356
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
356
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
357
357
  });
358
358
 
359
359
  it('should work with cross-file $ref', async () => {
@@ -388,7 +388,7 @@ describe('no-invalid-media-type-examples', () => {
388
388
  config: await makeConfig({ 'no-invalid-media-type-examples': 'error' }),
389
389
  });
390
390
 
391
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
391
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
392
392
  });
393
393
 
394
394
  it('should not throw for ajv throw', async () => {
@@ -417,23 +417,23 @@ describe('no-invalid-media-type-examples', () => {
417
417
  });
418
418
 
419
419
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
420
- Array [
421
- Object {
422
- "from": Object {
420
+ [
421
+ {
422
+ "from": {
423
423
  "pointer": "#/paths/~1pet/get/responses/200/content/application~1json",
424
424
  "source": "foobar.yaml",
425
425
  },
426
- "location": Array [
427
- Object {
426
+ "location": [
427
+ {
428
428
  "pointer": "#/paths/~1pet/get/responses/200/content/application~1json/schema",
429
429
  "reportOnKey": false,
430
430
  "source": "foobar.yaml",
431
431
  },
432
432
  ],
433
- "message": "Example validation errored: \\"nullable\\" cannot be used without \\"type\\".",
433
+ "message": "Example validation errored: "nullable" cannot be used without "type".",
434
434
  "ruleId": "no-invalid-media-type-examples",
435
435
  "severity": "error",
436
- "suggest": Array [],
436
+ "suggest": [],
437
437
  },
438
438
  ]
439
439
  `);
@@ -468,6 +468,6 @@ describe('no-invalid-media-type-examples', () => {
468
468
  config: await makeConfig({ 'no-invalid-media-type-examples': 'error' }),
469
469
  });
470
470
 
471
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
471
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
472
472
  });
473
473
  });
@@ -21,10 +21,10 @@ describe('Oas3 oas3-no-server-example.com', () => {
21
21
  });
22
22
 
23
23
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
24
- Array [
25
- Object {
26
- "location": Array [
27
- Object {
24
+ [
25
+ {
26
+ "location": [
27
+ {
28
28
  "pointer": "#/servers/0/url",
29
29
  "reportOnKey": false,
30
30
  "source": "foobar.yaml",
@@ -33,7 +33,7 @@ describe('Oas3 oas3-no-server-example.com', () => {
33
33
  "message": "Server \`url\` should not point to example.com or localhost.",
34
34
  "ruleId": "no-server-example.com",
35
35
  "severity": "error",
36
- "suggest": Array [],
36
+ "suggest": [],
37
37
  },
38
38
  ]
39
39
  `);
@@ -55,7 +55,7 @@ describe('Oas3 oas3-no-server-example.com', () => {
55
55
  config: await makeConfig({ 'no-server-example.com': 'error' }),
56
56
  });
57
57
 
58
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
58
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
59
59
  });
60
60
 
61
61
  it('oas3-no-server-example.com: should report on server object with "foo.example.com" url', async () => {
@@ -75,10 +75,10 @@ describe('Oas3 oas3-no-server-example.com', () => {
75
75
  });
76
76
 
77
77
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
78
- Array [
79
- Object {
80
- "location": Array [
81
- Object {
78
+ [
79
+ {
80
+ "location": [
81
+ {
82
82
  "pointer": "#/servers/0/url",
83
83
  "reportOnKey": false,
84
84
  "source": "foobar.yaml",
@@ -87,7 +87,7 @@ describe('Oas3 oas3-no-server-example.com', () => {
87
87
  "message": "Server \`url\` should not point to example.com or localhost.",
88
88
  "ruleId": "no-server-example.com",
89
89
  "severity": "error",
90
- "suggest": Array [],
90
+ "suggest": [],
91
91
  },
92
92
  ]
93
93
  `);
@@ -21,10 +21,10 @@ describe('Oas3 oas3-no-server-trailing-slash', () => {
21
21
  });
22
22
 
23
23
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
24
- Array [
25
- Object {
26
- "location": Array [
27
- Object {
24
+ [
25
+ {
26
+ "location": [
27
+ {
28
28
  "pointer": "#/servers/0/url",
29
29
  "reportOnKey": false,
30
30
  "source": "foobar.yaml",
@@ -33,7 +33,7 @@ describe('Oas3 oas3-no-server-trailing-slash', () => {
33
33
  "message": "Server \`url\` should not have a trailing slash.",
34
34
  "ruleId": "no-server-trailing-slash",
35
35
  "severity": "error",
36
- "suggest": Array [],
36
+ "suggest": [],
37
37
  },
38
38
  ]
39
39
  `);
@@ -55,7 +55,7 @@ describe('Oas3 oas3-no-server-trailing-slash', () => {
55
55
  config: await makeConfig({ 'no-server-trailing-slash': 'error' }),
56
56
  });
57
57
 
58
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
58
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
59
59
  });
60
60
 
61
61
  it('oas3-no-server-trailing-slash: should not report on server object with no trailing slash if the url is root', async () => {
@@ -74,6 +74,6 @@ describe('Oas3 oas3-no-server-trailing-slash', () => {
74
74
  config: await makeConfig({ 'no-server-trailing-slash': 'error' }),
75
75
  });
76
76
 
77
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
77
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
78
78
  });
79
79
  });
@@ -46,84 +46,84 @@ describe('Oas3 no-unused-components', () => {
46
46
  });
47
47
 
48
48
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
49
- Array [
50
- Object {
51
- "location": Array [
52
- Object {
49
+ [
50
+ {
51
+ "location": [
52
+ {
53
53
  "pointer": "#/components/parameters/unused",
54
54
  "reportOnKey": true,
55
55
  "source": "foobar.yaml",
56
56
  },
57
57
  ],
58
- "message": "Component: \\"unused\\" is never used.",
58
+ "message": "Component: "unused" is never used.",
59
59
  "ruleId": "no-unused-components",
60
60
  "severity": "error",
61
- "suggest": Array [],
61
+ "suggest": [],
62
62
  },
63
- Object {
64
- "location": Array [
65
- Object {
63
+ {
64
+ "location": [
65
+ {
66
66
  "pointer": "#/components/schemas/Unused",
67
67
  "reportOnKey": true,
68
68
  "source": "foobar.yaml",
69
69
  },
70
70
  ],
71
- "message": "Component: \\"Unused\\" is never used.",
71
+ "message": "Component: "Unused" is never used.",
72
72
  "ruleId": "no-unused-components",
73
73
  "severity": "error",
74
- "suggest": Array [],
74
+ "suggest": [],
75
75
  },
76
- Object {
77
- "location": Array [
78
- Object {
76
+ {
77
+ "location": [
78
+ {
79
79
  "pointer": "#/components/responses/unused",
80
80
  "reportOnKey": true,
81
81
  "source": "foobar.yaml",
82
82
  },
83
83
  ],
84
- "message": "Component: \\"unused\\" is never used.",
84
+ "message": "Component: "unused" is never used.",
85
85
  "ruleId": "no-unused-components",
86
86
  "severity": "error",
87
- "suggest": Array [],
87
+ "suggest": [],
88
88
  },
89
- Object {
90
- "location": Array [
91
- Object {
89
+ {
90
+ "location": [
91
+ {
92
92
  "pointer": "#/components/examples/unused",
93
93
  "reportOnKey": true,
94
94
  "source": "foobar.yaml",
95
95
  },
96
96
  ],
97
- "message": "Component: \\"unused\\" is never used.",
97
+ "message": "Component: "unused" is never used.",
98
98
  "ruleId": "no-unused-components",
99
99
  "severity": "error",
100
- "suggest": Array [],
100
+ "suggest": [],
101
101
  },
102
- Object {
103
- "location": Array [
104
- Object {
102
+ {
103
+ "location": [
104
+ {
105
105
  "pointer": "#/components/requestBodies/unused",
106
106
  "reportOnKey": true,
107
107
  "source": "foobar.yaml",
108
108
  },
109
109
  ],
110
- "message": "Component: \\"unused\\" is never used.",
110
+ "message": "Component: "unused" is never used.",
111
111
  "ruleId": "no-unused-components",
112
112
  "severity": "error",
113
- "suggest": Array [],
113
+ "suggest": [],
114
114
  },
115
- Object {
116
- "location": Array [
117
- Object {
115
+ {
116
+ "location": [
117
+ {
118
118
  "pointer": "#/components/headers/unused",
119
119
  "reportOnKey": true,
120
120
  "source": "foobar.yaml",
121
121
  },
122
122
  ],
123
- "message": "Component: \\"unused\\" is never used.",
123
+ "message": "Component: "unused" is never used.",
124
124
  "ruleId": "no-unused-components",
125
125
  "severity": "error",
126
- "suggest": Array [],
126
+ "suggest": [],
127
127
  },
128
128
  ]
129
129
  `);
@@ -35,10 +35,10 @@ describe('Oas3 operation-4xx-problem-details-rfc7807', () => {
35
35
  config: await makeConfig({ 'operation-4xx-problem-details-rfc7807': 'error' }),
36
36
  });
37
37
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
38
- Array [
39
- Object {
40
- "location": Array [
41
- Object {
38
+ [
39
+ {
40
+ "location": [
41
+ {
42
42
  "pointer": "#/paths/~1pets/get/responses/400",
43
43
  "reportOnKey": true,
44
44
  "source": "foobar.yaml",
@@ -47,7 +47,7 @@ describe('Oas3 operation-4xx-problem-details-rfc7807', () => {
47
47
  "message": "Response \`4xx\` must have content-type \`application/problem+json\`.",
48
48
  "ruleId": "operation-4xx-problem-details-rfc7807",
49
49
  "severity": "error",
50
- "suggest": Array [],
50
+ "suggest": [],
51
51
  },
52
52
  ]
53
53
  `);
@@ -82,10 +82,10 @@ describe('Oas3 operation-4xx-problem-details-rfc7807', () => {
82
82
  config: await makeConfig({ 'operation-4xx-problem-details-rfc7807': 'error' }),
83
83
  });
84
84
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
85
- Array [
86
- Object {
87
- "location": Array [
88
- Object {
85
+ [
86
+ {
87
+ "location": [
88
+ {
89
89
  "pointer": "#/paths/~1pets/get/responses/400/content/application~1problem+json/schema/properties/type",
90
90
  "reportOnKey": true,
91
91
  "source": "foobar.yaml",
@@ -94,7 +94,7 @@ describe('Oas3 operation-4xx-problem-details-rfc7807', () => {
94
94
  "message": "SchemaProperties object should contain \`type\` field.",
95
95
  "ruleId": "operation-4xx-problem-details-rfc7807",
96
96
  "severity": "error",
97
- "suggest": Array [],
97
+ "suggest": [],
98
98
  },
99
99
  ]
100
100
  `);
@@ -125,10 +125,10 @@ describe('Oas3 operation-4xx-problem-details-rfc7807', () => {
125
125
  config: await makeConfig({ 'operation-4xx-problem-details-rfc7807': 'error' }),
126
126
  });
127
127
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
128
- Array [
129
- Object {
130
- "location": Array [
131
- Object {
128
+ [
129
+ {
130
+ "location": [
131
+ {
132
132
  "pointer": "#/paths/~1pets/get/responses/400/content/application~1problem+json/schema",
133
133
  "reportOnKey": true,
134
134
  "source": "foobar.yaml",
@@ -137,7 +137,7 @@ describe('Oas3 operation-4xx-problem-details-rfc7807', () => {
137
137
  "message": "MediaType object should contain \`schema\` field.",
138
138
  "ruleId": "operation-4xx-problem-details-rfc7807",
139
139
  "severity": "error",
140
- "suggest": Array [],
140
+ "suggest": [],
141
141
  },
142
142
  ]
143
143
  `);
@@ -34,10 +34,10 @@ describe('Oas3 response-contains-header', () => {
34
34
  }),
35
35
  });
36
36
  expect(results).toMatchInlineSnapshot(`
37
- Array [
38
- Object {
39
- "location": Array [
40
- Object {
37
+ [
38
+ {
39
+ "location": [
40
+ {
41
41
  "pointer": "#/paths/~1store~1subscribe/post/responses/200/headers",
42
42
  "reportOnKey": true,
43
43
  "source": Source {
@@ -61,10 +61,10 @@ describe('Oas3 response-contains-header', () => {
61
61
  },
62
62
  },
63
63
  ],
64
- "message": "Response object must contain a \\"Content-Length\\" header.",
64
+ "message": "Response object must contain a "Content-Length" header.",
65
65
  "ruleId": "response-contains-header",
66
66
  "severity": "error",
67
- "suggest": Array [],
67
+ "suggest": [],
68
68
  },
69
69
  ]
70
70
  `);
@@ -117,10 +117,10 @@ describe('Oas3 response-contains-header', () => {
117
117
  }),
118
118
  });
119
119
  expect(results).toMatchInlineSnapshot(`
120
- Array [
121
- Object {
122
- "location": Array [
123
- Object {
120
+ [
121
+ {
122
+ "location": [
123
+ {
124
124
  "pointer": "#/paths/~1store~1subscribe/post/responses/200/headers",
125
125
  "reportOnKey": true,
126
126
  "source": Source {
@@ -159,14 +159,14 @@ describe('Oas3 response-contains-header', () => {
159
159
  },
160
160
  },
161
161
  ],
162
- "message": "Response object must contain a \\"x-request-id\\" header.",
162
+ "message": "Response object must contain a "x-request-id" header.",
163
163
  "ruleId": "response-contains-header",
164
164
  "severity": "error",
165
- "suggest": Array [],
165
+ "suggest": [],
166
166
  },
167
- Object {
168
- "location": Array [
169
- Object {
167
+ {
168
+ "location": [
169
+ {
170
170
  "pointer": "#/paths/~1store~1subscribe/post/responses/400/headers",
171
171
  "reportOnKey": true,
172
172
  "source": Source {
@@ -205,10 +205,10 @@ describe('Oas3 response-contains-header', () => {
205
205
  },
206
206
  },
207
207
  ],
208
- "message": "Response object must contain a \\"Content-Length\\" header.",
208
+ "message": "Response object must contain a "Content-Length" header.",
209
209
  "ruleId": "response-contains-header",
210
210
  "severity": "error",
211
- "suggest": Array [],
211
+ "suggest": [],
212
212
  },
213
213
  ]
214
214
  `);
@@ -268,7 +268,7 @@ describe('Oas3 response-contains-header', () => {
268
268
  },
269
269
  }),
270
270
  });
271
- expect(results).toMatchInlineSnapshot(`Array []`);
271
+ expect(results).toMatchInlineSnapshot(`[]`);
272
272
  });
273
273
 
274
274
  it('should not report response object containing header name upper cased', async () => {
@@ -300,7 +300,7 @@ describe('Oas3 response-contains-header', () => {
300
300
  },
301
301
  }),
302
302
  });
303
- expect(results).toMatchInlineSnapshot(`Array []`);
303
+ expect(results).toMatchInlineSnapshot(`[]`);
304
304
  });
305
305
 
306
306
  it('should not report response object containing header name in the rule upper cased', async () => {
@@ -332,7 +332,7 @@ describe('Oas3 response-contains-header', () => {
332
332
  },
333
333
  }),
334
334
  });
335
- expect(results).toMatchInlineSnapshot(`Array []`);
335
+ expect(results).toMatchInlineSnapshot(`[]`);
336
336
  });
337
337
 
338
338
  it('should report even if the response is null', async () => {
@@ -360,10 +360,10 @@ describe('Oas3 response-contains-header', () => {
360
360
  });
361
361
 
362
362
  expect(results).toMatchInlineSnapshot(`
363
- Array [
364
- Object {
365
- "location": Array [
366
- Object {
363
+ [
364
+ {
365
+ "location": [
366
+ {
367
367
  "pointer": "#/paths/~1test~1/put/responses/200/headers",
368
368
  "reportOnKey": true,
369
369
  "source": Source {
@@ -378,10 +378,10 @@ describe('Oas3 response-contains-header', () => {
378
378
  },
379
379
  },
380
380
  ],
381
- "message": "Response object must contain a \\"X-Test-Header\\" header.",
381
+ "message": "Response object must contain a "X-Test-Header" header.",
382
382
  "ruleId": "response-contains-header",
383
383
  "severity": "error",
384
- "suggest": Array [],
384
+ "suggest": [],
385
385
  },
386
386
  ]
387
387
  `);