@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
@@ -25,10 +25,10 @@ describe('Oas3 operation-4xx-response', () => {
25
25
  });
26
26
 
27
27
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
28
- Array [
29
- Object {
30
- "location": Array [
31
- Object {
28
+ [
29
+ {
30
+ "location": [
31
+ {
32
32
  "pointer": "#/paths/~1test/put/responses",
33
33
  "reportOnKey": true,
34
34
  "source": "foobar.yaml",
@@ -37,7 +37,7 @@ describe('Oas3 operation-4xx-response', () => {
37
37
  "message": "Operation must have at least one \`4XX\` response.",
38
38
  "ruleId": "operation-4xx-response",
39
39
  "severity": "error",
40
- "suggest": Array [],
40
+ "suggest": [],
41
41
  },
42
42
  ]
43
43
  `);
@@ -63,7 +63,7 @@ describe('Oas3 operation-4xx-response', () => {
63
63
  config: await makeConfig({ 'operation-4xx-response': 'error' }),
64
64
  });
65
65
 
66
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
66
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
67
67
  });
68
68
 
69
69
  it('should not report for present 4XX response', async () => {
@@ -86,7 +86,7 @@ describe('Oas3 operation-4xx-response', () => {
86
86
  config: await makeConfig({ 'operation-4xx-response': 'error' }),
87
87
  });
88
88
 
89
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
89
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
90
90
  });
91
91
 
92
92
  it('should report if default is present but missing 4xx response', async () => {
@@ -110,10 +110,10 @@ describe('Oas3 operation-4xx-response', () => {
110
110
  });
111
111
 
112
112
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
113
- Array [
114
- Object {
115
- "location": Array [
116
- Object {
113
+ [
114
+ {
115
+ "location": [
116
+ {
117
117
  "pointer": "#/paths/~1test~1/put/responses",
118
118
  "reportOnKey": true,
119
119
  "source": "foobar.yaml",
@@ -122,7 +122,7 @@ describe('Oas3 operation-4xx-response', () => {
122
122
  "message": "Operation must have at least one \`4XX\` response.",
123
123
  "ruleId": "operation-4xx-response",
124
124
  "severity": "error",
125
- "suggest": Array [],
125
+ "suggest": [],
126
126
  },
127
127
  ]
128
128
  `);
@@ -147,10 +147,10 @@ describe('Oas3 operation-4xx-response', () => {
147
147
  });
148
148
 
149
149
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
150
- Array [
151
- Object {
152
- "location": Array [
153
- Object {
150
+ [
151
+ {
152
+ "location": [
153
+ {
154
154
  "pointer": "#/paths/~1test~1/put/responses",
155
155
  "reportOnKey": true,
156
156
  "source": "foobar.yaml",
@@ -159,7 +159,7 @@ describe('Oas3 operation-4xx-response', () => {
159
159
  "message": "Operation must have at least one \`2XX\` response.",
160
160
  "ruleId": "operation-2xx-response",
161
161
  "severity": "error",
162
- "suggest": Array [],
162
+ "suggest": [],
163
163
  },
164
164
  ]
165
165
  `);
@@ -188,10 +188,10 @@ describe('Oas3 operation-4xx-response', () => {
188
188
  });
189
189
 
190
190
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
191
- Array [
192
- Object {
193
- "location": Array [
194
- Object {
191
+ [
192
+ {
193
+ "location": [
194
+ {
195
195
  "pointer": "#/webhooks/~1test~1/put/responses",
196
196
  "reportOnKey": true,
197
197
  "source": "foobar.yaml",
@@ -200,7 +200,7 @@ describe('Oas3 operation-4xx-response', () => {
200
200
  "message": "Operation must have at least one \`4XX\` response.",
201
201
  "ruleId": "operation-4xx-response",
202
202
  "severity": "error",
203
- "suggest": Array [],
203
+ "suggest": [],
204
204
  },
205
205
  ]
206
206
  `);
@@ -226,6 +226,6 @@ describe('Oas3 operation-4xx-response', () => {
226
226
  config: await makeConfig({ 'operation-4xx-response': 'error' }),
227
227
  });
228
228
 
229
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
229
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
230
230
  });
231
231
  });
@@ -30,10 +30,10 @@ describe('Oas3 operation-operationId-unique', () => {
30
30
  });
31
31
 
32
32
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
33
- Array [
34
- Object {
35
- "location": Array [
36
- Object {
33
+ [
34
+ {
35
+ "location": [
36
+ {
37
37
  "pointer": "#/paths/~1test2/post/test2",
38
38
  "reportOnKey": false,
39
39
  "source": "foobar.yaml",
@@ -42,7 +42,7 @@ describe('Oas3 operation-operationId-unique', () => {
42
42
  "message": "Every operation must have a unique \`operationId\`.",
43
43
  "ruleId": "operation-operationId-unique",
44
44
  "severity": "error",
45
- "suggest": Array [],
45
+ "suggest": [],
46
46
  },
47
47
  ]
48
48
  `);
@@ -71,6 +71,6 @@ describe('Oas3 operation-operationId-unique', () => {
71
71
  config: await makeConfig({ 'peration-operationId-unique': 'error' }),
72
72
  });
73
73
 
74
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
74
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
75
75
  });
76
76
  });
@@ -25,10 +25,10 @@ describe('Oas3 operation-operationId-url-safe', () => {
25
25
  });
26
26
 
27
27
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
28
- Array [
29
- Object {
30
- "location": Array [
31
- Object {
28
+ [
29
+ {
30
+ "location": [
31
+ {
32
32
  "pointer": "#/paths/~1test/put/operationId",
33
33
  "reportOnKey": false,
34
34
  "source": "foobar.yaml",
@@ -37,7 +37,7 @@ describe('Oas3 operation-operationId-url-safe', () => {
37
37
  "message": "Operation \`operationId\` should not have URL invalid characters.",
38
38
  "ruleId": "operation-operationId-url-safe",
39
39
  "severity": "error",
40
- "suggest": Array [],
40
+ "suggest": [],
41
41
  },
42
42
  ]
43
43
  `);
@@ -26,10 +26,10 @@ describe('Oas3 operation-parameters-unique', () => {
26
26
  });
27
27
 
28
28
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
29
- Array [
30
- Object {
31
- "location": Array [
32
- Object {
29
+ [
30
+ {
31
+ "location": [
32
+ {
33
33
  "pointer": "#/paths/~1test/parameters/1",
34
34
  "reportOnKey": false,
35
35
  "source": "foobar.yaml",
@@ -39,7 +39,7 @@ describe('Oas3 operation-parameters-unique', () => {
39
39
  Repeats of \`in:query\` + \`name:a\`.",
40
40
  "ruleId": "operation-parameters-unique",
41
41
  "severity": "error",
42
- "suggest": Array [],
42
+ "suggest": [],
43
43
  },
44
44
  ]
45
45
  `);
@@ -68,7 +68,7 @@ describe('Oas3 operation-parameters-unique', () => {
68
68
  config: await makeConfig({ 'operation-parameters-unique': 'error' }),
69
69
  });
70
70
 
71
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
71
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
72
72
  });
73
73
 
74
74
  it('should report when operation with duplicated params', async () => {
@@ -99,10 +99,10 @@ describe('Oas3 operation-parameters-unique', () => {
99
99
  });
100
100
 
101
101
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
102
- Array [
103
- Object {
104
- "location": Array [
105
- Object {
102
+ [
103
+ {
104
+ "location": [
105
+ {
106
106
  "pointer": "#/paths/~1test/put/parameters/2",
107
107
  "reportOnKey": false,
108
108
  "source": "foobar.yaml",
@@ -111,7 +111,7 @@ describe('Oas3 operation-parameters-unique', () => {
111
111
  "message": "Operations must have unique \`name\` + \`in\` parameters. Repeats of \`in:query\` + \`name:a\`.",
112
112
  "ruleId": "operation-parameters-unique",
113
113
  "severity": "error",
114
- "suggest": Array [],
114
+ "suggest": [],
115
115
  },
116
116
  ]
117
117
  `);
@@ -147,10 +147,10 @@ describe('Oas3 operation-parameters-unique', () => {
147
147
  });
148
148
 
149
149
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
150
- Array [
151
- Object {
152
- "location": Array [
153
- Object {
150
+ [
151
+ {
152
+ "location": [
153
+ {
154
154
  "pointer": "#/paths/~1test/put/parameters/2",
155
155
  "reportOnKey": false,
156
156
  "source": "foobar.yaml",
@@ -159,7 +159,7 @@ describe('Oas3 operation-parameters-unique', () => {
159
159
  "message": "Operations must have unique \`name\` + \`in\` parameters. Repeats of \`in:query\` + \`name:a\`.",
160
160
  "ruleId": "operation-parameters-unique",
161
161
  "severity": "error",
162
- "suggest": Array [],
162
+ "suggest": [],
163
163
  },
164
164
  ]
165
165
  `);
@@ -28,10 +28,10 @@ describe('Oas3 operation-singular-tag', () => {
28
28
  });
29
29
 
30
30
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
31
- Array [
32
- Object {
33
- "location": Array [
34
- Object {
31
+ [
32
+ {
33
+ "location": [
34
+ {
35
35
  "pointer": "#/paths/~1some/get/tags",
36
36
  "reportOnKey": true,
37
37
  "source": "foobar.yaml",
@@ -40,7 +40,7 @@ describe('Oas3 operation-singular-tag', () => {
40
40
  "message": "Operation \`tags\` object should have only one tag.",
41
41
  "ruleId": "operation-singular-tag",
42
42
  "severity": "error",
43
- "suggest": Array [],
43
+ "suggest": [],
44
44
  },
45
45
  ]
46
46
  `);
@@ -67,6 +67,6 @@ describe('Oas3 operation-singular-tag', () => {
67
67
  config: await makeConfig({ 'operation-singular-tag': 'error' }),
68
68
  });
69
69
 
70
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
70
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
71
71
  });
72
72
  });
@@ -27,10 +27,10 @@ describe('Common path-http-verbs-order', () => {
27
27
  });
28
28
 
29
29
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
30
- Array [
31
- Object {
32
- "location": Array [
33
- Object {
30
+ [
31
+ {
32
+ "location": [
33
+ {
34
34
  "pointer": "#/paths/~1some/post",
35
35
  "reportOnKey": true,
36
36
  "source": "foobar.yaml",
@@ -39,11 +39,11 @@ describe('Common path-http-verbs-order', () => {
39
39
  "message": "Operation http verbs must be ordered.",
40
40
  "ruleId": "path-http-verbs-order",
41
41
  "severity": "error",
42
- "suggest": Array [],
42
+ "suggest": [],
43
43
  },
44
- Object {
45
- "location": Array [
46
- Object {
44
+ {
45
+ "location": [
46
+ {
47
47
  "pointer": "#/paths/~1some/get",
48
48
  "reportOnKey": true,
49
49
  "source": "foobar.yaml",
@@ -52,7 +52,7 @@ describe('Common path-http-verbs-order', () => {
52
52
  "message": "Operation http verbs must be ordered.",
53
53
  "ruleId": "path-http-verbs-order",
54
54
  "severity": "error",
55
- "suggest": Array [],
55
+ "suggest": [],
56
56
  },
57
57
  ]
58
58
  `);
@@ -90,6 +90,6 @@ describe('Common path-http-verbs-order', () => {
90
90
  config: await makeConfig({ 'path-http-verbs-order': 'error' }),
91
91
  });
92
92
 
93
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
93
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
94
94
  });
95
95
  });
@@ -23,10 +23,10 @@ describe('Oas3 path-not-include-query', () => {
23
23
  });
24
24
 
25
25
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
26
- Array [
27
- Object {
28
- "location": Array [
29
- Object {
26
+ [
27
+ {
28
+ "location": [
29
+ {
30
30
  "pointer": "#/paths/~1some?input",
31
31
  "reportOnKey": true,
32
32
  "source": "foobar.yaml",
@@ -35,7 +35,7 @@ describe('Oas3 path-not-include-query', () => {
35
35
  "message": "Don't put query string items in the path, they belong in parameters with \`in: query\`.",
36
36
  "ruleId": "path-not-include-query",
37
37
  "severity": "error",
38
- "suggest": Array [],
38
+ "suggest": [],
39
39
  },
40
40
  ]
41
41
  `);
@@ -59,6 +59,6 @@ describe('Oas3 path-not-include-query', () => {
59
59
  config: await makeConfig({ 'path-not-include-query': 'error' }),
60
60
  });
61
61
 
62
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
62
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
63
63
  });
64
64
  });
@@ -27,7 +27,7 @@ describe('Oas3 path-params-defined', () => {
27
27
  config: await makeConfig({ 'path-params-defined': 'error' }),
28
28
  });
29
29
 
30
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
30
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
31
31
  });
32
32
 
33
33
  it('should report on undefined param params', async () => {
@@ -56,10 +56,10 @@ describe('Oas3 path-params-defined', () => {
56
56
  });
57
57
 
58
58
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
59
- Array [
60
- Object {
61
- "location": Array [
62
- Object {
59
+ [
60
+ {
61
+ "location": [
62
+ {
63
63
  "pointer": "#/paths/~1pets~1{a}~1{b}/get/parameters",
64
64
  "reportOnKey": true,
65
65
  "source": "foobar.yaml",
@@ -68,7 +68,7 @@ describe('Oas3 path-params-defined', () => {
68
68
  "message": "The operation does not define the path parameter \`{b}\` expected by path \`/pets/{a}/{b}\`.",
69
69
  "ruleId": "path-params-defined",
70
70
  "severity": "error",
71
- "suggest": Array [],
71
+ "suggest": [],
72
72
  },
73
73
  ]
74
74
  `);
@@ -100,10 +100,10 @@ describe('Oas3 path-params-defined', () => {
100
100
  });
101
101
 
102
102
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
103
- Array [
104
- Object {
105
- "location": Array [
106
- Object {
103
+ [
104
+ {
105
+ "location": [
106
+ {
107
107
  "pointer": "#/paths/~1pets~1{a}/parameters/1/name",
108
108
  "reportOnKey": false,
109
109
  "source": "foobar.yaml",
@@ -112,11 +112,11 @@ describe('Oas3 path-params-defined', () => {
112
112
  "message": "Path parameter \`d\` is not used in the path \`/pets/{a}\`.",
113
113
  "ruleId": "path-params-defined",
114
114
  "severity": "error",
115
- "suggest": Array [],
115
+ "suggest": [],
116
116
  },
117
- Object {
118
- "location": Array [
119
- Object {
117
+ {
118
+ "location": [
119
+ {
120
120
  "pointer": "#/paths/~1pets~1{a}/get/parameters/0/name",
121
121
  "reportOnKey": false,
122
122
  "source": "foobar.yaml",
@@ -125,7 +125,7 @@ describe('Oas3 path-params-defined', () => {
125
125
  "message": "Path parameter \`c\` is not used in the path \`/pets/{a}\`.",
126
126
  "ruleId": "path-params-defined",
127
127
  "severity": "error",
128
- "suggest": Array [],
128
+ "suggest": [],
129
129
  },
130
130
  ]
131
131
  `);
@@ -154,10 +154,10 @@ describe('Oas3 path-params-defined', () => {
154
154
  });
155
155
 
156
156
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
157
- Array [
158
- Object {
159
- "location": Array [
160
- Object {
157
+ [
158
+ {
159
+ "location": [
160
+ {
161
161
  "pointer": "#/paths/~1pets~1{a}/post/parameters",
162
162
  "reportOnKey": true,
163
163
  "source": "foobar.yaml",
@@ -166,7 +166,7 @@ describe('Oas3 path-params-defined', () => {
166
166
  "message": "The operation does not define the path parameter \`{a}\` expected by path \`/pets/{a}\`.",
167
167
  "ruleId": "path-params-defined",
168
168
  "severity": "error",
169
- "suggest": Array [],
169
+ "suggest": [],
170
170
  },
171
171
  ]
172
172
  `);
@@ -197,6 +197,6 @@ describe('Oas3 path-params-defined', () => {
197
197
  config: await makeConfig({ 'path-params-defined': 'error' }),
198
198
  });
199
199
 
200
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
200
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
201
201
  });
202
202
  });
@@ -26,10 +26,10 @@ describe('Oas3 paths-kebab-case', () => {
26
26
  });
27
27
 
28
28
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
29
- Array [
30
- Object {
31
- "location": Array [
32
- Object {
29
+ [
30
+ {
31
+ "location": [
32
+ {
33
33
  "pointer": "#/paths/~1someTest",
34
34
  "reportOnKey": true,
35
35
  "source": "foobar.yaml",
@@ -38,7 +38,7 @@ describe('Oas3 paths-kebab-case', () => {
38
38
  "message": "\`/someTest\` does not use kebab-case.",
39
39
  "ruleId": "paths-kebab-case",
40
40
  "severity": "error",
41
- "suggest": Array [],
41
+ "suggest": [],
42
42
  },
43
43
  ]
44
44
  `);
@@ -65,10 +65,10 @@ describe('Oas3 paths-kebab-case', () => {
65
65
  });
66
66
 
67
67
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
68
- Array [
69
- Object {
70
- "location": Array [
71
- Object {
68
+ [
69
+ {
70
+ "location": [
71
+ {
72
72
  "pointer": "#/paths/~1some_test",
73
73
  "reportOnKey": true,
74
74
  "source": "foobar.yaml",
@@ -77,7 +77,7 @@ describe('Oas3 paths-kebab-case', () => {
77
77
  "message": "\`/some_test\` does not use kebab-case.",
78
78
  "ruleId": "paths-kebab-case",
79
79
  "severity": "error",
80
- "suggest": Array [],
80
+ "suggest": [],
81
81
  },
82
82
  ]
83
83
  `);
@@ -103,6 +103,6 @@ describe('Oas3 paths-kebab-case', () => {
103
103
  'no-path-trailing-slash': 'off',
104
104
  }),
105
105
  });
106
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
106
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
107
107
  });
108
108
  });
@@ -28,19 +28,19 @@ describe('Oas3 scalar-property-missing-example', () => {
28
28
  });
29
29
 
30
30
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
31
- Array [
32
- Object {
33
- "location": Array [
34
- Object {
31
+ [
32
+ {
33
+ "location": [
34
+ {
35
35
  "pointer": "#/components/schemas/User/properties/email",
36
36
  "reportOnKey": true,
37
37
  "source": "foobar.yaml",
38
38
  },
39
39
  ],
40
- "message": "Scalar property should have \\"example\\" defined.",
40
+ "message": "Scalar property should have "example" defined.",
41
41
  "ruleId": "scalar-property-missing-example",
42
42
  "severity": "error",
43
- "suggest": Array [],
43
+ "suggest": [],
44
44
  },
45
45
  ]
46
46
  `);
@@ -72,19 +72,19 @@ describe('Oas3.1 scalar-property-missing-example', () => {
72
72
  });
73
73
 
74
74
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
75
- Array [
76
- Object {
77
- "location": Array [
78
- Object {
75
+ [
76
+ {
77
+ "location": [
78
+ {
79
79
  "pointer": "#/components/schemas/User/properties/email",
80
80
  "reportOnKey": true,
81
81
  "source": "foobar.yaml",
82
82
  },
83
83
  ],
84
- "message": "Scalar property should have \\"example\\" or \\"examples\\" defined.",
84
+ "message": "Scalar property should have "example" or "examples" defined.",
85
85
  "ruleId": "scalar-property-missing-example",
86
86
  "severity": "error",
87
- "suggest": Array [],
87
+ "suggest": [],
88
88
  },
89
89
  ]
90
90
  `);
@@ -114,7 +114,7 @@ describe('Oas3.1 scalar-property-missing-example', () => {
114
114
  config: await makeConfig({ 'scalar-property-missing-example': 'error' }),
115
115
  });
116
116
 
117
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
117
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
118
118
  });
119
119
 
120
120
  it('should not report on a scalar property with an examples', async () => {
@@ -143,7 +143,7 @@ describe('Oas3.1 scalar-property-missing-example', () => {
143
143
  config: await makeConfig({ 'scalar-property-missing-example': 'error' }),
144
144
  });
145
145
 
146
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
146
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
147
147
  });
148
148
 
149
149
  it('should not report on a non-scalar property missing an example', async () => {
@@ -177,7 +177,7 @@ describe('Oas3.1 scalar-property-missing-example', () => {
177
177
  config: await makeConfig({ 'scalar-property-missing-example': 'error' }),
178
178
  });
179
179
 
180
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
180
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
181
181
  });
182
182
 
183
183
  it('should not report on a scalar property of binary format missing an example', async () => {
@@ -202,7 +202,7 @@ describe('Oas3.1 scalar-property-missing-example', () => {
202
202
  config: await makeConfig({ 'scalar-property-missing-example': 'error' }),
203
203
  });
204
204
 
205
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
205
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
206
206
  });
207
207
 
208
208
  it('should not report on a scalar property of falsy values', async () => {
@@ -233,7 +233,7 @@ describe('Oas3.1 scalar-property-missing-example', () => {
233
233
  config: await makeConfig({ 'scalar-property-missing-example': 'error' }),
234
234
  });
235
235
 
236
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
236
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
237
237
  });
238
238
 
239
239
  it('should not report on a nullable scalar property values', async () => {
@@ -259,6 +259,6 @@ describe('Oas3.1 scalar-property-missing-example', () => {
259
259
  config: await makeConfig({ 'scalar-property-missing-example': 'error' }),
260
260
  });
261
261
 
262
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
262
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
263
263
  });
264
264
  });