@redocly/openapi-core 1.3.0 → 1.4.1

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 (202) hide show
  1. package/CHANGELOG.md +18 -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 +25 -25
  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/decorators/oas2/remove-unused-components.d.ts +2 -0
  40. package/lib/{rules → decorators}/oas2/remove-unused-components.js +1 -1
  41. package/lib/decorators/oas3/remove-unused-components.d.ts +2 -0
  42. package/lib/{rules → decorators}/oas3/remove-unused-components.js +2 -2
  43. package/lib/env.js +1 -1
  44. package/lib/format/codeframes.d.ts +6 -6
  45. package/lib/format/format.d.ts +2 -2
  46. package/lib/format/format.js +12 -12
  47. package/lib/js-yaml/index.d.ts +2 -2
  48. package/lib/js-yaml/index.js +2 -2
  49. package/lib/lint.js +18 -18
  50. package/lib/oas-types.d.ts +12 -10
  51. package/lib/oas-types.js +2 -2
  52. package/lib/redocly/index.js +10 -10
  53. package/lib/redocly/registry-api.js +2 -2
  54. package/lib/resolve.d.ts +4 -4
  55. package/lib/resolve.js +18 -18
  56. package/lib/rules/ajv.js +1 -1
  57. package/lib/rules/async2/index.d.ts +2 -11
  58. package/lib/rules/common/assertions/asserts.d.ts +3 -3
  59. package/lib/rules/common/assertions/asserts.js +21 -21
  60. package/lib/rules/common/assertions/index.d.ts +4 -4
  61. package/lib/rules/common/assertions/index.js +3 -3
  62. package/lib/rules/common/assertions/utils.d.ts +4 -4
  63. package/lib/rules/common/assertions/utils.js +3 -3
  64. package/lib/rules/common/info-contact.js +1 -1
  65. package/lib/rules/common/info-license-url.js +1 -1
  66. package/lib/rules/common/info-license.js +1 -1
  67. package/lib/rules/common/no-enum-type-mismatch.js +3 -3
  68. package/lib/rules/common/no-http-verbs-in-paths.js +2 -2
  69. package/lib/rules/common/no-invalid-parameter-examples.js +3 -3
  70. package/lib/rules/common/no-invalid-schema-examples.js +3 -3
  71. package/lib/rules/common/operation-2xx-response.js +2 -2
  72. package/lib/rules/common/operation-4xx-response.js +2 -2
  73. package/lib/rules/common/operation-description.js +1 -1
  74. package/lib/rules/common/operation-operationId.js +1 -1
  75. package/lib/rules/common/operation-summary.js +1 -1
  76. package/lib/rules/common/path-segment-plural.js +1 -1
  77. package/lib/rules/common/response-contains-header.js +2 -2
  78. package/lib/rules/common/spec-strict-refs.js +1 -1
  79. package/lib/rules/common/spec.js +11 -11
  80. package/lib/rules/common/tag-description.js +1 -1
  81. package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +1 -1
  82. package/lib/rules/oas2/index.d.ts +2 -46
  83. package/lib/rules/oas2/request-mime-type.js +2 -2
  84. package/lib/rules/oas2/response-contains-property.js +2 -2
  85. package/lib/rules/oas2/response-mime-type.js +2 -2
  86. package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +1 -1
  87. package/lib/rules/oas3/index.d.ts +1 -1
  88. package/lib/rules/oas3/index.js +1 -1
  89. package/lib/rules/oas3/no-invalid-media-type-examples.js +3 -3
  90. package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +3 -3
  91. package/lib/rules/oas3/request-mime-type.js +3 -3
  92. package/lib/rules/oas3/response-contains-property.js +2 -2
  93. package/lib/rules/oas3/response-mime-type.js +3 -3
  94. package/lib/rules/utils.js +3 -3
  95. package/lib/types/asyncapi.js +21 -21
  96. package/lib/types/index.d.ts +8 -8
  97. package/lib/types/oas2.js +14 -14
  98. package/lib/types/oas3.js +27 -27
  99. package/lib/types/oas3_1.js +18 -6
  100. package/lib/types/redocly-yaml.d.ts +11 -0
  101. package/lib/types/redocly-yaml.js +71 -53
  102. package/lib/types/theme-config.js +1 -1
  103. package/lib/typings/common.d.ts +2 -2
  104. package/lib/typings/openapi.d.ts +6 -6
  105. package/lib/typings/swagger.d.ts +3 -3
  106. package/lib/utils.d.ts +5 -5
  107. package/lib/utils.js +3 -3
  108. package/lib/visitors.d.ts +38 -40
  109. package/lib/walk.d.ts +14 -15
  110. package/lib/walk.js +11 -11
  111. package/package.json +2 -2
  112. package/src/__tests__/lint.test.ts +40 -40
  113. package/src/__tests__/normalizeVisitors.test.ts +23 -5
  114. package/src/__tests__/ref-utils.test.ts +7 -7
  115. package/src/__tests__/resolve-http.test.ts +10 -10
  116. package/src/__tests__/resolve.test.ts +39 -39
  117. package/src/__tests__/walk.test.ts +48 -48
  118. package/src/bundle.ts +4 -4
  119. package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +95 -32
  120. package/src/config/__tests__/__snapshots__/config.test.ts.snap +81 -81
  121. package/src/config/__tests__/config-resolvers.test.ts +30 -1
  122. package/src/config/__tests__/config.test.ts +88 -88
  123. package/src/config/__tests__/load.test.ts +12 -8
  124. package/src/config/__tests__/utils.test.ts +18 -18
  125. package/src/config/all.ts +46 -9
  126. package/src/config/builtIn.ts +2 -0
  127. package/src/config/minimal.ts +36 -4
  128. package/src/config/recommended-strict.ts +93 -0
  129. package/src/config/recommended.ts +36 -4
  130. package/src/config/types.ts +22 -8
  131. package/src/config/utils.ts +15 -0
  132. package/src/decorators/common/media-type-examples-override.ts +2 -2
  133. package/src/{rules → decorators}/oas2/remove-unused-components.ts +3 -3
  134. package/src/{rules → decorators}/oas3/remove-unused-components.ts +3 -3
  135. package/src/env.ts +1 -1
  136. package/src/lint.ts +3 -3
  137. package/src/oas-types.ts +26 -3
  138. package/src/rules/__tests__/no-unresolved-refs.test.ts +26 -26
  139. package/src/rules/async2/__tests__/channels-kebab-case.test.ts +12 -12
  140. package/src/rules/async2/__tests__/no-channel-trailing-slash.test.ts +7 -7
  141. package/src/rules/async2/index.ts +2 -1
  142. package/src/rules/common/__tests__/info-license.test.ts +6 -6
  143. package/src/rules/common/__tests__/license-url.test.ts +6 -6
  144. package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +13 -13
  145. package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +18 -18
  146. package/src/rules/common/__tests__/no-identical-paths.test.ts +5 -5
  147. package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +12 -12
  148. package/src/rules/common/__tests__/operation-2xx-response.test.ts +18 -18
  149. package/src/rules/common/__tests__/operation-4xx-response.test.ts +23 -23
  150. package/src/rules/common/__tests__/operation-operationId-unique.test.ts +6 -6
  151. package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +5 -5
  152. package/src/rules/common/__tests__/operation-parameters-unique.test.ts +16 -16
  153. package/src/rules/common/__tests__/operation-singular-tag.test.ts +6 -6
  154. package/src/rules/common/__tests__/path-http-verbs-order.test.ts +10 -10
  155. package/src/rules/common/__tests__/path-not-include-query.test.ts +6 -6
  156. package/src/rules/common/__tests__/path-params-defined.test.ts +21 -21
  157. package/src/rules/common/__tests__/paths-kebab-case.test.ts +11 -11
  158. package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +18 -18
  159. package/src/rules/common/__tests__/security-defined.test.ts +21 -21
  160. package/src/rules/common/__tests__/spec-strict-refs.test.ts +9 -9
  161. package/src/rules/common/__tests__/spec.test.ts +102 -102
  162. package/src/rules/common/__tests__/tag-description.test.ts +6 -6
  163. package/src/rules/common/__tests__/tags-alphabetical.test.ts +12 -12
  164. package/src/rules/common/assertions/__tests__/index.test.ts +15 -15
  165. package/src/rules/common/assertions/__tests__/utils.test.ts +9 -9
  166. package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +7 -7
  167. package/src/rules/oas2/__tests__/response-contains-header.test.ts +13 -13
  168. package/src/rules/oas2/__tests__/response-contains-property.test.ts +8 -8
  169. package/src/rules/oas2/__tests__/spec/info.test.ts +21 -21
  170. package/src/rules/oas2/__tests__/spec/operation.test.ts +4 -4
  171. package/src/rules/oas2/__tests__/spec/paths.test.ts +12 -12
  172. package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +1 -1
  173. package/src/rules/oas2/index.ts +3 -1
  174. package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +7 -7
  175. package/src/rules/oas3/__tests__/component-name-unique.test.ts +186 -186
  176. package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +18 -18
  177. package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +6 -6
  178. package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +36 -36
  179. package/src/rules/oas3/__tests__/no-server-example.com.test.ts +11 -11
  180. package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +7 -7
  181. package/src/rules/oas3/__tests__/no-unused-components.test.ts +31 -31
  182. package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +15 -15
  183. package/src/rules/oas3/__tests__/response-contains-header.test.ts +26 -26
  184. package/src/rules/oas3/__tests__/response-contains-property.test.ts +27 -27
  185. package/src/rules/oas3/__tests__/spec/callbacks.test.ts +1 -1
  186. package/src/rules/oas3/__tests__/spec/info.test.ts +21 -21
  187. package/src/rules/oas3/__tests__/spec/operation.test.ts +10 -10
  188. package/src/rules/oas3/__tests__/spec/paths.test.ts +13 -13
  189. package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +2 -2
  190. package/src/rules/oas3/__tests__/spec/servers.test.ts +25 -25
  191. package/src/rules/oas3/__tests__/spec/spec.test.ts +56 -56
  192. package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +28 -28
  193. package/src/rules/oas3/index.ts +3 -3
  194. package/src/types/oas3_1.ts +12 -0
  195. package/src/types/redocly-yaml.ts +75 -40
  196. package/src/visitors.ts +10 -21
  197. package/src/walk.ts +23 -10
  198. package/tsconfig.tsbuildinfo +1 -1
  199. package/lib/rules/oas2/remove-unused-components.d.ts +0 -2
  200. package/lib/rules/oas3/remove-unused-components.d.ts +0 -2
  201. /package/src/{rules → decorators}/oas2/__tests__/remove-unused-components.test.ts +0 -0
  202. /package/src/{rules → decorators}/oas3/__tests__/remove-unused-components.test.ts +0 -0
@@ -34,10 +34,10 @@ describe('Oas3 response-contains-property', () => {
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/201/content/application~1json/schema/properties",
42
42
  "reportOnKey": true,
43
43
  "source": Source {
@@ -62,10 +62,10 @@ describe('Oas3 response-contains-property', () => {
62
62
  },
63
63
  },
64
64
  ],
65
- "message": "Response object must contain a top-level \\"id\\" property.",
65
+ "message": "Response object must contain a top-level "id" property.",
66
66
  "ruleId": "response-contains-property",
67
67
  "severity": "error",
68
- "suggest": Array [],
68
+ "suggest": [],
69
69
  },
70
70
  ]
71
71
  `);
@@ -110,10 +110,10 @@ describe('Oas3 response-contains-property', () => {
110
110
  }),
111
111
  });
112
112
  expect(results).toMatchInlineSnapshot(`
113
- Array [
114
- Object {
115
- "location": Array [
116
- Object {
113
+ [
114
+ {
115
+ "location": [
116
+ {
117
117
  "pointer": "#/paths/~1store~1subscribe/post/responses/201/content/application~1json/schema/properties",
118
118
  "reportOnKey": true,
119
119
  "source": Source {
@@ -147,14 +147,14 @@ describe('Oas3 response-contains-property', () => {
147
147
  },
148
148
  },
149
149
  ],
150
- "message": "Response object must contain a top-level \\"id\\" property.",
150
+ "message": "Response object must contain a top-level "id" property.",
151
151
  "ruleId": "response-contains-property",
152
152
  "severity": "error",
153
- "suggest": Array [],
153
+ "suggest": [],
154
154
  },
155
- Object {
156
- "location": Array [
157
- Object {
155
+ {
156
+ "location": [
157
+ {
158
158
  "pointer": "#/paths/~1store~1subscribe/post/responses/400/content/application~1json/schema/properties",
159
159
  "reportOnKey": true,
160
160
  "source": Source {
@@ -188,10 +188,10 @@ describe('Oas3 response-contains-property', () => {
188
188
  },
189
189
  },
190
190
  ],
191
- "message": "Response object must contain a top-level \\"error\\" property.",
191
+ "message": "Response object must contain a top-level "error" property.",
192
192
  "ruleId": "response-contains-property",
193
193
  "severity": "error",
194
- "suggest": Array [],
194
+ "suggest": [],
195
195
  },
196
196
  ]
197
197
  `);
@@ -237,7 +237,7 @@ describe('Oas3 response-contains-property', () => {
237
237
  },
238
238
  }),
239
239
  });
240
- expect(results).toMatchInlineSnapshot(`Array []`);
240
+ expect(results).toMatchInlineSnapshot(`[]`);
241
241
  });
242
242
 
243
243
  it('should not report a response object when schema type is not object', async () => {
@@ -265,7 +265,7 @@ describe('Oas3 response-contains-property', () => {
265
265
  },
266
266
  }),
267
267
  });
268
- expect(results).toMatchInlineSnapshot(`Array []`);
268
+ expect(results).toMatchInlineSnapshot(`[]`);
269
269
  });
270
270
 
271
271
  it('should not report response objects when there is no `names` field specified', async () => {
@@ -305,7 +305,7 @@ describe('Oas3 response-contains-property', () => {
305
305
  },
306
306
  }),
307
307
  });
308
- expect(results).toMatchInlineSnapshot(`Array []`);
308
+ expect(results).toMatchInlineSnapshot(`[]`);
309
309
  });
310
310
 
311
311
  it('should not report response objects for 204 status code', async () => {
@@ -337,7 +337,7 @@ describe('Oas3 response-contains-property', () => {
337
337
  },
338
338
  }),
339
339
  });
340
- expect(results).toMatchInlineSnapshot(`Array []`);
340
+ expect(results).toMatchInlineSnapshot(`[]`);
341
341
  });
342
342
 
343
343
  it('should report response objects when there are no properties', async () => {
@@ -367,10 +367,10 @@ describe('Oas3 response-contains-property', () => {
367
367
  }),
368
368
  });
369
369
  expect(results).toMatchInlineSnapshot(`
370
- Array [
371
- Object {
372
- "location": Array [
373
- Object {
370
+ [
371
+ {
372
+ "location": [
373
+ {
374
374
  "pointer": "#/paths/~1store~1subscribe/post/responses/200/content/application~1json/schema/properties",
375
375
  "reportOnKey": true,
376
376
  "source": Source {
@@ -392,10 +392,10 @@ describe('Oas3 response-contains-property', () => {
392
392
  },
393
393
  },
394
394
  ],
395
- "message": "Response object must contain a top-level \\"id\\" property.",
395
+ "message": "Response object must contain a top-level "id" property.",
396
396
  "ruleId": "response-contains-property",
397
397
  "severity": "error",
398
- "suggest": Array [],
398
+ "suggest": [],
399
399
  },
400
400
  ]
401
401
  `);
@@ -37,5 +37,5 @@ it('should not fail on valid callbacks object', async () => {
37
37
  await validateDoc(source, {
38
38
  spec: 'error',
39
39
  })
40
- ).toMatchInlineSnapshot(`Array []`);
40
+ ).toMatchInlineSnapshot(`[]`);
41
41
  });
@@ -25,8 +25,8 @@ describe('OpenAPI Schema', () => {
25
25
  spec: 'error',
26
26
  })
27
27
  ).toMatchInlineSnapshot(`
28
- Array [
29
- Object {
28
+ [
29
+ {
30
30
  "location": "#/info/title",
31
31
  "message": "Expected type \`string\` but got \`null\`.",
32
32
  },
@@ -58,8 +58,8 @@ describe('OpenAPI Schema', () => {
58
58
  spec: 'error',
59
59
  })
60
60
  ).toMatchInlineSnapshot(`
61
- Array [
62
- Object {
61
+ [
62
+ {
63
63
  "location": "#/info/description",
64
64
  "message": "Expected type \`string\` but got \`null\`.",
65
65
  },
@@ -91,8 +91,8 @@ describe('OpenAPI Schema', () => {
91
91
  spec: 'error',
92
92
  })
93
93
  ).toMatchInlineSnapshot(`
94
- Array [
95
- Object {
94
+ [
95
+ {
96
96
  "location": "#/info/termsOfService",
97
97
  "message": "Expected type \`string\` but got \`null\`.",
98
98
  },
@@ -127,7 +127,7 @@ describe('OpenAPI Schema', () => {
127
127
  await validateDoc(source, {
128
128
  spec: 'error',
129
129
  })
130
- ).toMatchInlineSnapshot(`Array []`);
130
+ ).toMatchInlineSnapshot(`[]`);
131
131
  });
132
132
 
133
133
  it('should report if in the Contact Object in URL field is not string', async () => {
@@ -157,8 +157,8 @@ describe('OpenAPI Schema', () => {
157
157
  spec: 'error',
158
158
  })
159
159
  ).toMatchInlineSnapshot(`
160
- Array [
161
- Object {
160
+ [
161
+ {
162
162
  "location": "#/info/contact/url",
163
163
  "message": "Expected type \`string\` but got \`null\`.",
164
164
  },
@@ -193,8 +193,8 @@ describe('OpenAPI Schema', () => {
193
193
  spec: 'error',
194
194
  })
195
195
  ).toMatchInlineSnapshot(`
196
- Array [
197
- Object {
196
+ [
197
+ {
198
198
  "location": "#/info/contact/email",
199
199
  "message": "Expected type \`string\` but got \`null\`.",
200
200
  },
@@ -227,7 +227,7 @@ describe('OpenAPI Schema', () => {
227
227
  await validateDoc(source, {
228
228
  spec: 'error',
229
229
  })
230
- ).toMatchInlineSnapshot(`Array []`);
230
+ ).toMatchInlineSnapshot(`[]`);
231
231
  });
232
232
 
233
233
  it('should report if the License Object missing field Name', async () => {
@@ -255,8 +255,8 @@ describe('OpenAPI Schema', () => {
255
255
  spec: 'error',
256
256
  })
257
257
  ).toMatchInlineSnapshot(`
258
- Array [
259
- Object {
258
+ [
259
+ {
260
260
  "location": "#/info/license",
261
261
  "message": "The field \`name\` must be present on this level.",
262
262
  },
@@ -290,8 +290,8 @@ describe('OpenAPI Schema', () => {
290
290
  spec: 'error',
291
291
  })
292
292
  ).toMatchInlineSnapshot(`
293
- Array [
294
- Object {
293
+ [
294
+ {
295
295
  "location": "#/info/license/url",
296
296
  "message": "Expected type \`string\` but got \`null\`.",
297
297
  },
@@ -323,7 +323,7 @@ describe('OpenAPI Schema', () => {
323
323
  await validateDoc(source, {
324
324
  spec: 'error',
325
325
  })
326
- ).toMatchInlineSnapshot(`Array []`);
326
+ ).toMatchInlineSnapshot(`[]`);
327
327
  });
328
328
 
329
329
  it('should report if the Version field is not provided', async () => {
@@ -348,8 +348,8 @@ describe('OpenAPI Schema', () => {
348
348
  spec: 'error',
349
349
  })
350
350
  ).toMatchInlineSnapshot(`
351
- Array [
352
- Object {
351
+ [
352
+ {
353
353
  "location": "#/info",
354
354
  "message": "The field \`version\` must be present on this level.",
355
355
  },
@@ -380,8 +380,8 @@ describe('OpenAPI Schema', () => {
380
380
  spec: 'error',
381
381
  })
382
382
  ).toMatchInlineSnapshot(`
383
- Array [
384
- Object {
383
+ [
384
+ {
385
385
  "location": "#/info/version",
386
386
  "message": "Expected type \`string\` but got \`null\`.",
387
387
  },
@@ -24,7 +24,7 @@ it('should not report if summary field is valid', async () => {
24
24
  await validateDoc(source, {
25
25
  spec: 'error',
26
26
  })
27
- ).toMatchInlineSnapshot(`Array []`);
27
+ ).toMatchInlineSnapshot(`[]`);
28
28
  });
29
29
 
30
30
  it('should report if summary field is not string ', async () => {
@@ -51,8 +51,8 @@ it('should report if summary field is not string ', async () => {
51
51
  spec: 'error',
52
52
  })
53
53
  ).toMatchInlineSnapshot(`
54
- Array [
55
- Object {
54
+ [
55
+ {
56
56
  "location": "#/paths/~1ping/summary",
57
57
  "message": "Expected type \`string\` but got \`null\`.",
58
58
  },
@@ -83,7 +83,7 @@ it('should not report if description field is valid', async () => {
83
83
  await validateDoc(source, {
84
84
  spec: 'error',
85
85
  })
86
- ).toMatchInlineSnapshot(`Array []`);
86
+ ).toMatchInlineSnapshot(`[]`);
87
87
  });
88
88
 
89
89
  it('should report if description field is not string', async () => {
@@ -110,8 +110,8 @@ it('should report if description field is not string', async () => {
110
110
  spec: 'error',
111
111
  })
112
112
  ).toMatchInlineSnapshot(`
113
- Array [
114
- Object {
113
+ [
114
+ {
115
115
  "location": "#/paths/~1ping/description",
116
116
  "message": "Expected type \`string\` but got \`null\`.",
117
117
  },
@@ -141,7 +141,7 @@ it('should not report of a valid GET operation object', async () => {
141
141
  await validateDoc(source, {
142
142
  spec: 'error',
143
143
  })
144
- ).toMatchInlineSnapshot(`Array []`);
144
+ ).toMatchInlineSnapshot(`[]`);
145
145
  });
146
146
 
147
147
  it('should not report of a valid PUT operation object', async () => {
@@ -171,7 +171,7 @@ it('should not report of a valid PUT operation object', async () => {
171
171
  await validateDoc(source, {
172
172
  spec: 'error',
173
173
  })
174
- ).toMatchInlineSnapshot(`Array []`);
174
+ ).toMatchInlineSnapshot(`[]`);
175
175
  });
176
176
 
177
177
  it('should not report of a valid Post operation object', async () => {
@@ -209,7 +209,7 @@ it('should not report of a valid Post operation object', async () => {
209
209
  await validateDoc(source, {
210
210
  spec: 'error',
211
211
  })
212
- ).toMatchInlineSnapshot(`Array []`);
212
+ ).toMatchInlineSnapshot(`[]`);
213
213
  });
214
214
 
215
215
  it('should not report of a valid delete operation object', async () => {
@@ -249,5 +249,5 @@ it('should not report of a valid delete operation object', async () => {
249
249
  await validateDoc(source, {
250
250
  spec: 'error',
251
251
  })
252
- ).toMatchInlineSnapshot(`Array []`);
252
+ ).toMatchInlineSnapshot(`[]`);
253
253
  });
@@ -24,7 +24,7 @@ describe('OpenAPI Schema', () => {
24
24
  await validateDoc(source, {
25
25
  spec: 'error',
26
26
  })
27
- ).toMatchInlineSnapshot(`Array []`);
27
+ ).toMatchInlineSnapshot(`[]`);
28
28
  });
29
29
 
30
30
  it('should not report if Path object is empty ', async () => {
@@ -44,7 +44,7 @@ describe('OpenAPI Schema', () => {
44
44
  await validateDoc(source, {
45
45
  spec: 'error',
46
46
  })
47
- ).toMatchInlineSnapshot(`Array []`);
47
+ ).toMatchInlineSnapshot(`[]`);
48
48
  });
49
49
 
50
50
  it('should report if Path object is not present ', async () => {
@@ -63,8 +63,8 @@ describe('OpenAPI Schema', () => {
63
63
  spec: 'error',
64
64
  })
65
65
  ).toMatchInlineSnapshot(`
66
- Array [
67
- Object {
66
+ [
67
+ {
68
68
  "location": "#/",
69
69
  "message": "The field \`paths\` must be present on this level.",
70
70
  },
@@ -89,7 +89,7 @@ describe('OpenAPI Schema', () => {
89
89
  await validateDoc(source, {
90
90
  spec: 'error',
91
91
  })
92
- ).toMatchInlineSnapshot(`Array []`);
92
+ ).toMatchInlineSnapshot(`[]`);
93
93
  });
94
94
 
95
95
  //Check: no error
@@ -116,8 +116,8 @@ describe('OpenAPI Schema', () => {
116
116
  spec: 'error',
117
117
  })
118
118
  ).toMatchInlineSnapshot(`
119
- Array [
120
- Object {
119
+ [
120
+ {
121
121
  "location": "#/paths/ping",
122
122
  "message": "Property \`ping\` is not expected here.",
123
123
  },
@@ -153,8 +153,8 @@ describe('OpenAPI Schema', () => {
153
153
  'no-identical-paths': 'error',
154
154
  })
155
155
  ).toMatchInlineSnapshot(`
156
- Array [
157
- Object {
156
+ [
157
+ {
158
158
  "location": "#/paths/~1pets~1{name}",
159
159
  "message": "The path already exists which differs only by path parameter name(s): \`/pets/{petId}\` and \`/pets/{name}\`.",
160
160
  },
@@ -189,7 +189,7 @@ describe('OpenAPI Schema', () => {
189
189
  await validateDoc(source, {
190
190
  spec: 'error',
191
191
  })
192
- ).toMatchInlineSnapshot(`Array []`);
192
+ ).toMatchInlineSnapshot(`[]`);
193
193
  });
194
194
 
195
195
  it('should not report in case of ambiguous matching ', async () => {
@@ -219,7 +219,7 @@ describe('OpenAPI Schema', () => {
219
219
  await validateDoc(source, {
220
220
  spec: 'error',
221
221
  })
222
- ).toMatchInlineSnapshot(`Array []`);
222
+ ).toMatchInlineSnapshot(`[]`);
223
223
  });
224
224
 
225
225
  it('should not report if Path Item is empty ', async () => {
@@ -240,7 +240,7 @@ describe('OpenAPI Schema', () => {
240
240
  await validateDoc(source, {
241
241
  spec: 'error',
242
242
  })
243
- ).toMatchInlineSnapshot(`Array []`);
243
+ ).toMatchInlineSnapshot(`[]`);
244
244
  });
245
245
 
246
246
  it('should not report of a valid Parameter Object', async () => {
@@ -279,6 +279,6 @@ describe('OpenAPI Schema', () => {
279
279
  await validateDoc(source, {
280
280
  spec: 'error',
281
281
  })
282
- ).toMatchInlineSnapshot(`Array []`);
282
+ ).toMatchInlineSnapshot(`[]`);
283
283
  });
284
284
  });
@@ -35,7 +35,7 @@ describe('Referenceable scalars', () => {
35
35
  })
36
36
  ),
37
37
  });
38
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
38
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
39
39
  });
40
40
 
41
41
  it('should not report invalid $ref on example with doNotResolveExamples', async () => {
@@ -72,6 +72,6 @@ describe('Referenceable scalars', () => {
72
72
  })
73
73
  ),
74
74
  });
75
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
75
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
76
76
  });
77
77
  });
@@ -25,7 +25,7 @@ describe('OpenAPI Schema', () => {
25
25
  await validateDoc(source, {
26
26
  spec: 'error',
27
27
  })
28
- ).toMatchInlineSnapshot(`Array []`);
28
+ ).toMatchInlineSnapshot(`[]`);
29
29
  });
30
30
 
31
31
  it('should report on empty server URL', async () => {
@@ -51,8 +51,8 @@ describe('OpenAPI Schema', () => {
51
51
  spec: 'error',
52
52
  })
53
53
  ).toMatchInlineSnapshot(`
54
- Array [
55
- Object {
54
+ [
55
+ {
56
56
  "location": "#/servers/0/url",
57
57
  "message": "Expected type \`string\` but got \`null\`.",
58
58
  },
@@ -83,8 +83,8 @@ describe('OpenAPI Schema', () => {
83
83
  spec: 'error',
84
84
  })
85
85
  ).toMatchInlineSnapshot(`
86
- Array [
87
- Object {
86
+ [
87
+ {
88
88
  "location": "#/servers/0",
89
89
  "message": "The field \`url\` must be present on this level.",
90
90
  },
@@ -116,8 +116,8 @@ describe('OpenAPI Schema', () => {
116
116
  spec: 'error',
117
117
  })
118
118
  ).toMatchInlineSnapshot(`
119
- Array [
120
- Object {
119
+ [
120
+ {
121
121
  "location": "#/servers/0/description",
122
122
  "message": "Expected type \`string\` but got \`null\`.",
123
123
  },
@@ -147,7 +147,7 @@ describe('OpenAPI Schema', () => {
147
147
  await validateDoc(source, {
148
148
  spec: 'error',
149
149
  })
150
- ).toMatchInlineSnapshot(`Array []`);
150
+ ).toMatchInlineSnapshot(`[]`);
151
151
  });
152
152
 
153
153
  it('should report if fields type in servers are not array', async () => {
@@ -173,8 +173,8 @@ describe('OpenAPI Schema', () => {
173
173
  spec: 'error',
174
174
  })
175
175
  ).toMatchInlineSnapshot(`
176
- Array [
177
- Object {
176
+ [
177
+ {
178
178
  "location": "#/servers",
179
179
  "message": "Expected type \`ServerList\` (array) but got \`object\`",
180
180
  },
@@ -209,7 +209,7 @@ describe('OpenAPI Schema', () => {
209
209
  await validateDoc(source, {
210
210
  spec: 'error',
211
211
  })
212
- ).toMatchInlineSnapshot(`Array []`);
212
+ ).toMatchInlineSnapshot(`[]`);
213
213
  });
214
214
 
215
215
  it('should not report if variables are used for a server configuration', async () => {
@@ -244,7 +244,7 @@ describe('OpenAPI Schema', () => {
244
244
  await validateDoc(source, {
245
245
  spec: 'error',
246
246
  })
247
- ).toMatchInlineSnapshot(`Array []`);
247
+ ).toMatchInlineSnapshot(`[]`);
248
248
  });
249
249
 
250
250
  it('should report if array in enum is empty', async () => {
@@ -279,8 +279,8 @@ describe('OpenAPI Schema', () => {
279
279
  spec: 'error',
280
280
  })
281
281
  ).toMatchInlineSnapshot(`
282
- Array [
283
- Object {
282
+ [
283
+ {
284
284
  "location": "#/servers/0/variables/port/enum",
285
285
  "message": "Expected type \`array\` but got \`null\`.",
286
286
  },
@@ -319,8 +319,8 @@ describe('OpenAPI Schema', () => {
319
319
  'no-undefined-server-variable': 'error',
320
320
  })
321
321
  ).toMatchInlineSnapshot(`
322
- Array [
323
- Object {
322
+ [
323
+ {
324
324
  "location": "#/servers/0/url",
325
325
  "message": "The \`basePath\` variable is not defined in the \`variables\` objects.",
326
326
  },
@@ -359,12 +359,12 @@ describe('OpenAPI Schema', () => {
359
359
  spec: 'error',
360
360
  })
361
361
  ).toMatchInlineSnapshot(`
362
- Array [
363
- Object {
362
+ [
363
+ {
364
364
  "location": "#/servers/0/variables/username",
365
365
  "message": "The field \`default\` must be present on this level.",
366
366
  },
367
- Object {
367
+ {
368
368
  "location": "#/servers/0/variables/port",
369
369
  "message": "The field \`default\` must be present on this level.",
370
370
  },
@@ -405,8 +405,8 @@ describe('OpenAPI Schema', () => {
405
405
  spec: 'error',
406
406
  })
407
407
  ).toMatchInlineSnapshot(`
408
- Array [
409
- Object {
408
+ [
409
+ {
410
410
  "location": "#/servers/0/variables/username/default",
411
411
  "message": "Expected type \`string\` but got \`null\`.",
412
412
  },
@@ -448,8 +448,8 @@ describe('OpenAPI Schema', () => {
448
448
  spec: 'error',
449
449
  })
450
450
  ).toMatchInlineSnapshot(`
451
- Array [
452
- Object {
451
+ [
452
+ {
453
453
  "location": "#/servers/0/variables/username/description",
454
454
  "message": "Expected type \`string\` but got \`null\`.",
455
455
  },
@@ -476,7 +476,7 @@ describe('OpenAPI Schema', () => {
476
476
  await validateDoc(source, {
477
477
  spec: 'error',
478
478
  })
479
- ).toMatchInlineSnapshot(`Array []`);
479
+ ).toMatchInlineSnapshot(`[]`);
480
480
  });
481
481
 
482
482
  it('should not report if servers property is an empty array', async () => {
@@ -500,6 +500,6 @@ describe('OpenAPI Schema', () => {
500
500
  await validateDoc(source, {
501
501
  spec: 'error',
502
502
  })
503
- ).toMatchInlineSnapshot(`Array []`);
503
+ ).toMatchInlineSnapshot(`[]`);
504
504
  });
505
505
  });