@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
@@ -23,10 +23,10 @@ describe('Oas3 security-defined', () => {
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/~1pets/get/security/0/some",
31
31
  "reportOnKey": true,
32
32
  "source": "foobar.yaml",
@@ -35,7 +35,7 @@ describe('Oas3 security-defined', () => {
35
35
  "message": "There is no \`some\` security scheme defined.",
36
36
  "ruleId": "security-defined",
37
37
  "severity": "error",
38
- "suggest": Array [],
38
+ "suggest": [],
39
39
  },
40
40
  ]
41
41
  `);
@@ -56,7 +56,7 @@ describe('Oas3 security-defined', () => {
56
56
  config: await makeConfig({ 'security-defined': 'error' }),
57
57
  });
58
58
 
59
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
59
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
60
60
  });
61
61
 
62
62
  it('should report if security not defined at all', async () => {
@@ -77,10 +77,10 @@ describe('Oas3 security-defined', () => {
77
77
  });
78
78
 
79
79
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
80
- Array [
81
- Object {
82
- "location": Array [
83
- Object {
80
+ [
81
+ {
82
+ "location": [
83
+ {
84
84
  "pointer": "#/paths/~1pets/get",
85
85
  "reportOnKey": true,
86
86
  "source": "foobar.yaml",
@@ -89,7 +89,7 @@ describe('Oas3 security-defined', () => {
89
89
  "message": "Every operation should have security defined on it or on the root level.",
90
90
  "ruleId": "security-defined",
91
91
  "severity": "error",
92
- "suggest": Array [],
92
+ "suggest": [],
93
93
  },
94
94
  ]
95
95
  `);
@@ -116,10 +116,10 @@ describe('Oas3 security-defined', () => {
116
116
  });
117
117
 
118
118
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
119
- Array [
120
- Object {
121
- "location": Array [
122
- Object {
119
+ [
120
+ {
121
+ "location": [
122
+ {
123
123
  "pointer": "#/paths/~1pets/get/security/0/some",
124
124
  "reportOnKey": true,
125
125
  "source": "foobar.yaml",
@@ -128,11 +128,11 @@ describe('Oas3 security-defined', () => {
128
128
  "message": "There is no \`some\` security scheme defined.",
129
129
  "ruleId": "security-defined",
130
130
  "severity": "error",
131
- "suggest": Array [],
131
+ "suggest": [],
132
132
  },
133
- Object {
134
- "location": Array [
135
- Object {
133
+ {
134
+ "location": [
135
+ {
136
136
  "pointer": "#/paths/~1cats/get",
137
137
  "reportOnKey": true,
138
138
  "source": "foobar.yaml",
@@ -141,7 +141,7 @@ describe('Oas3 security-defined', () => {
141
141
  "message": "Every operation should have security defined on it or on the root level.",
142
142
  "ruleId": "security-defined",
143
143
  "severity": "error",
144
- "suggest": Array [],
144
+ "suggest": [],
145
145
  },
146
146
  ]
147
147
  `);
@@ -170,6 +170,6 @@ describe('Oas3 security-defined', () => {
170
170
  config: await makeConfig({ 'security-defined': 'error' }),
171
171
  });
172
172
 
173
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
173
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
174
174
  });
175
175
  });
@@ -36,10 +36,10 @@ describe('Oas3 spec-strict-refs', () => {
36
36
  config: await makeConfig({ 'spec-strict-refs': 'error' }),
37
37
  });
38
38
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
39
- Array [
40
- Object {
41
- "location": Array [
42
- Object {
39
+ [
40
+ {
41
+ "location": [
42
+ {
43
43
  "pointer": "#/info/$ref",
44
44
  "reportOnKey": true,
45
45
  "source": "",
@@ -48,11 +48,11 @@ describe('Oas3 spec-strict-refs', () => {
48
48
  "message": "Field $ref is not expected here.",
49
49
  "ruleId": "spec-strict-refs",
50
50
  "severity": "error",
51
- "suggest": Array [],
51
+ "suggest": [],
52
52
  },
53
- Object {
54
- "location": Array [
55
- Object {
53
+ {
54
+ "location": [
55
+ {
56
56
  "pointer": "#/paths/~1store~1subscribe/post/responses/201/content/application~1json/schema/properties/$ref",
57
57
  "reportOnKey": true,
58
58
  "source": "",
@@ -61,7 +61,7 @@ describe('Oas3 spec-strict-refs', () => {
61
61
  "message": "Field $ref is not expected here.",
62
62
  "ruleId": "spec-strict-refs",
63
63
  "severity": "error",
64
- "suggest": Array [],
64
+ "suggest": [],
65
65
  },
66
66
  ]
67
67
  `);
@@ -29,11 +29,11 @@ describe('Oas3 spec', () => {
29
29
  });
30
30
 
31
31
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
32
- Array [
33
- Object {
32
+ [
33
+ {
34
34
  "from": undefined,
35
- "location": Array [
36
- Object {
35
+ "location": [
36
+ {
37
37
  "pointer": "#/",
38
38
  "reportOnKey": true,
39
39
  "source": "foobar.yaml",
@@ -42,12 +42,12 @@ describe('Oas3 spec', () => {
42
42
  "message": "The field \`info\` must be present on this level.",
43
43
  "ruleId": "spec",
44
44
  "severity": "error",
45
- "suggest": Array [],
45
+ "suggest": [],
46
46
  },
47
- Object {
47
+ {
48
48
  "from": undefined,
49
- "location": Array [
50
- Object {
49
+ "location": [
50
+ {
51
51
  "pointer": "#/paths/~1test/get/parameters/0",
52
52
  "reportOnKey": true,
53
53
  "source": "foobar.yaml",
@@ -56,7 +56,7 @@ describe('Oas3 spec', () => {
56
56
  "message": "Must contain at least one of the following fields: schema, content.",
57
57
  "ruleId": "spec",
58
58
  "severity": "error",
59
- "suggest": Array [],
59
+ "suggest": [],
60
60
  },
61
61
  ]
62
62
  `);
@@ -89,11 +89,11 @@ describe('Oas3 spec', () => {
89
89
  });
90
90
 
91
91
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
92
- Array [
93
- Object {
92
+ [
93
+ {
94
94
  "from": undefined,
95
- "location": Array [
96
- Object {
95
+ "location": [
96
+ {
97
97
  "pointer": "#/",
98
98
  "reportOnKey": true,
99
99
  "source": "foobar.yaml",
@@ -102,12 +102,12 @@ describe('Oas3 spec', () => {
102
102
  "message": "The field \`paths\` must be present on this level.",
103
103
  "ruleId": "spec",
104
104
  "severity": "error",
105
- "suggest": Array [],
105
+ "suggest": [],
106
106
  },
107
- Object {
107
+ {
108
108
  "from": undefined,
109
- "location": Array [
110
- Object {
109
+ "location": [
110
+ {
111
111
  "pointer": "#/",
112
112
  "reportOnKey": true,
113
113
  "source": "foobar.yaml",
@@ -116,15 +116,15 @@ describe('Oas3 spec', () => {
116
116
  "message": "The field \`info\` must be present on this level.",
117
117
  "ruleId": "spec",
118
118
  "severity": "error",
119
- "suggest": Array [],
119
+ "suggest": [],
120
120
  },
121
- Object {
122
- "from": Object {
121
+ {
122
+ "from": {
123
123
  "pointer": "#/components/schemas/TestSchema/allOf/0",
124
124
  "source": "foobar.yaml",
125
125
  },
126
- "location": Array [
127
- Object {
126
+ "location": [
127
+ {
128
128
  "pointer": "#/components/requestBodies/TestRequestBody/content",
129
129
  "reportOnKey": true,
130
130
  "source": "foobar.yaml",
@@ -133,7 +133,7 @@ describe('Oas3 spec', () => {
133
133
  "message": "Property \`content\` is not expected here.",
134
134
  "ruleId": "spec",
135
135
  "severity": "error",
136
- "suggest": Array [],
136
+ "suggest": [],
137
137
  },
138
138
  ]
139
139
  `);
@@ -161,11 +161,11 @@ describe('Oas3 spec', () => {
161
161
  });
162
162
 
163
163
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
164
- Array [
165
- Object {
164
+ [
165
+ {
166
166
  "from": undefined,
167
- "location": Array [
168
- Object {
167
+ "location": [
168
+ {
169
169
  "pointer": "#/",
170
170
  "reportOnKey": true,
171
171
  "source": "foobar.yaml",
@@ -174,12 +174,12 @@ describe('Oas3 spec', () => {
174
174
  "message": "The field \`paths\` must be present on this level.",
175
175
  "ruleId": "spec",
176
176
  "severity": "error",
177
- "suggest": Array [],
177
+ "suggest": [],
178
178
  },
179
- Object {
179
+ {
180
180
  "from": undefined,
181
- "location": Array [
182
- Object {
181
+ "location": [
182
+ {
183
183
  "pointer": "#/",
184
184
  "reportOnKey": true,
185
185
  "source": "foobar.yaml",
@@ -188,11 +188,11 @@ describe('Oas3 spec', () => {
188
188
  "message": "The field \`info\` must be present on this level.",
189
189
  "ruleId": "spec",
190
190
  "severity": "error",
191
- "suggest": Array [],
191
+ "suggest": [],
192
192
  },
193
- Object {
194
- "location": Array [
195
- Object {
193
+ {
194
+ "location": [
195
+ {
196
196
  "pointer": "#/components/requestBodies/TestRequestBody/content/application~1json/schema/nullable",
197
197
  "reportOnKey": false,
198
198
  "source": "foobar.yaml",
@@ -201,7 +201,7 @@ describe('Oas3 spec', () => {
201
201
  "message": "The \`type\` field must be defined when the \`nullable\` field is used.",
202
202
  "ruleId": "spec",
203
203
  "severity": "error",
204
- "suggest": Array [],
204
+ "suggest": [],
205
205
  },
206
206
  ]
207
207
  `);
@@ -235,11 +235,11 @@ describe('Oas3 spec', () => {
235
235
  });
236
236
 
237
237
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
238
- Array [
239
- Object {
238
+ [
239
+ {
240
240
  "from": undefined,
241
- "location": Array [
242
- Object {
241
+ "location": [
242
+ {
243
243
  "pointer": "#/",
244
244
  "reportOnKey": true,
245
245
  "source": "foobar.yaml",
@@ -248,12 +248,12 @@ describe('Oas3 spec', () => {
248
248
  "message": "The field \`paths\` must be present on this level.",
249
249
  "ruleId": "spec",
250
250
  "severity": "error",
251
- "suggest": Array [],
251
+ "suggest": [],
252
252
  },
253
- Object {
253
+ {
254
254
  "from": undefined,
255
- "location": Array [
256
- Object {
255
+ "location": [
256
+ {
257
257
  "pointer": "#/",
258
258
  "reportOnKey": true,
259
259
  "source": "foobar.yaml",
@@ -262,11 +262,11 @@ describe('Oas3 spec', () => {
262
262
  "message": "The field \`info\` must be present on this level.",
263
263
  "ruleId": "spec",
264
264
  "severity": "error",
265
- "suggest": Array [],
265
+ "suggest": [],
266
266
  },
267
- Object {
268
- "location": Array [
269
- Object {
267
+ {
268
+ "location": [
269
+ {
270
270
  "pointer": "#/components/requestBodies/TestRequestBody/content/application~1json/schema/nullable",
271
271
  "reportOnKey": false,
272
272
  "source": "foobar.yaml",
@@ -275,12 +275,12 @@ describe('Oas3 spec', () => {
275
275
  "message": "The \`type\` field must be defined when the \`nullable\` field is used.",
276
276
  "ruleId": "spec",
277
277
  "severity": "error",
278
- "suggest": Array [],
278
+ "suggest": [],
279
279
  },
280
- Object {
280
+ {
281
281
  "from": undefined,
282
- "location": Array [
283
- Object {
282
+ "location": [
283
+ {
284
284
  "pointer": "#/components/requestBodies/schemas",
285
285
  "reportOnKey": true,
286
286
  "source": "foobar.yaml",
@@ -289,12 +289,12 @@ describe('Oas3 spec', () => {
289
289
  "message": "The field \`content\` must be present on this level.",
290
290
  "ruleId": "spec",
291
291
  "severity": "error",
292
- "suggest": Array [],
292
+ "suggest": [],
293
293
  },
294
- Object {
294
+ {
295
295
  "from": undefined,
296
- "location": Array [
297
- Object {
296
+ "location": [
297
+ {
298
298
  "pointer": "#/components/requestBodies/schemas/TestSchema",
299
299
  "reportOnKey": true,
300
300
  "source": "foobar.yaml",
@@ -303,7 +303,7 @@ describe('Oas3 spec', () => {
303
303
  "message": "Property \`TestSchema\` is not expected here.",
304
304
  "ruleId": "spec",
305
305
  "severity": "error",
306
- "suggest": Array [],
306
+ "suggest": [],
307
307
  },
308
308
  ]
309
309
  `);
@@ -326,11 +326,11 @@ describe('Oas3 spec', () => {
326
326
  });
327
327
 
328
328
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
329
- Array [
330
- Object {
329
+ [
330
+ {
331
331
  "from": undefined,
332
- "location": Array [
333
- Object {
332
+ "location": [
333
+ {
334
334
  "pointer": "#/",
335
335
  "reportOnKey": true,
336
336
  "source": "foobar.yaml",
@@ -339,12 +339,12 @@ describe('Oas3 spec', () => {
339
339
  "message": "The field \`paths\` must be present on this level.",
340
340
  "ruleId": "spec",
341
341
  "severity": "error",
342
- "suggest": Array [],
342
+ "suggest": [],
343
343
  },
344
- Object {
344
+ {
345
345
  "from": undefined,
346
- "location": Array [
347
- Object {
346
+ "location": [
347
+ {
348
348
  "pointer": "#/",
349
349
  "reportOnKey": true,
350
350
  "source": "foobar.yaml",
@@ -353,7 +353,7 @@ describe('Oas3 spec', () => {
353
353
  "message": "The field \`info\` must be present on this level.",
354
354
  "ruleId": "spec",
355
355
  "severity": "error",
356
- "suggest": Array [],
356
+ "suggest": [],
357
357
  },
358
358
  ]
359
359
  `);
@@ -388,20 +388,20 @@ describe('Oas3.1 spec', () => {
388
388
  });
389
389
 
390
390
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
391
- Array [
392
- Object {
391
+ [
392
+ {
393
393
  "from": undefined,
394
- "location": Array [
395
- Object {
394
+ "location": [
395
+ {
396
396
  "pointer": "#/components/schemas/TestSchema/type",
397
397
  "reportOnKey": false,
398
398
  "source": "",
399
399
  },
400
400
  ],
401
- "message": "\`type\` can be one of the following only: \\"object\\", \\"array\\", \\"string\\", \\"number\\", \\"integer\\", \\"boolean\\", \\"null\\".",
401
+ "message": "\`type\` can be one of the following only: "object", "array", "string", "number", "integer", "boolean", "null".",
402
402
  "ruleId": "spec",
403
403
  "severity": "error",
404
- "suggest": Array [],
404
+ "suggest": [],
405
405
  },
406
406
  ]
407
407
  `);
@@ -436,20 +436,20 @@ describe('Oas3.1 spec', () => {
436
436
  });
437
437
 
438
438
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
439
- Array [
440
- Object {
439
+ [
440
+ {
441
441
  "from": undefined,
442
- "location": Array [
443
- Object {
442
+ "location": [
443
+ {
444
444
  "pointer": "#/components/schemas/TestSchema/type/1",
445
445
  "reportOnKey": false,
446
446
  "source": "",
447
447
  },
448
448
  ],
449
- "message": "\`type\` can be one of the following only: \\"object\\", \\"array\\", \\"string\\", \\"number\\", \\"integer\\", \\"boolean\\", \\"null\\".",
449
+ "message": "\`type\` can be one of the following only: "object", "array", "string", "number", "integer", "boolean", "null".",
450
450
  "ruleId": "spec",
451
451
  "severity": "error",
452
- "suggest": Array [],
452
+ "suggest": [],
453
453
  },
454
454
  ]
455
455
  `);
@@ -490,20 +490,20 @@ describe('Oas3.1 spec', () => {
490
490
  });
491
491
 
492
492
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
493
- Array [
494
- Object {
493
+ [
494
+ {
495
495
  "from": undefined,
496
- "location": Array [
497
- Object {
496
+ "location": [
497
+ {
498
498
  "pointer": "#/components/schemas/WrongType/type",
499
499
  "reportOnKey": false,
500
500
  "source": "",
501
501
  },
502
502
  ],
503
- "message": "\`type\` can be one of the following only: \\"object\\", \\"array\\", \\"string\\", \\"number\\", \\"integer\\", \\"boolean\\", \\"null\\".",
503
+ "message": "\`type\` can be one of the following only: "object", "array", "string", "number", "integer", "boolean", "null".",
504
504
  "ruleId": "spec",
505
505
  "severity": "error",
506
- "suggest": Array [
506
+ "suggest": [
507
507
  "object",
508
508
  "array",
509
509
  "string",
@@ -513,19 +513,19 @@ describe('Oas3.1 spec', () => {
513
513
  "null",
514
514
  ],
515
515
  },
516
- Object {
516
+ {
517
517
  "from": undefined,
518
- "location": Array [
519
- Object {
518
+ "location": [
519
+ {
520
520
  "pointer": "#/components/schemas/WrongArrayType/type/0",
521
521
  "reportOnKey": false,
522
522
  "source": "",
523
523
  },
524
524
  ],
525
- "message": "\`type\` can be one of the following only: \\"object\\", \\"array\\", \\"string\\", \\"number\\", \\"integer\\", \\"boolean\\", \\"null\\".",
525
+ "message": "\`type\` can be one of the following only: "object", "array", "string", "number", "integer", "boolean", "null".",
526
526
  "ruleId": "spec",
527
527
  "severity": "error",
528
- "suggest": Array [
528
+ "suggest": [
529
529
  "object",
530
530
  "array",
531
531
  "string",
@@ -561,11 +561,11 @@ describe('Oas3.1 spec', () => {
561
561
  });
562
562
 
563
563
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
564
- Array [
565
- Object {
564
+ [
565
+ {
566
566
  "from": undefined,
567
- "location": Array [
568
- Object {
567
+ "location": [
568
+ {
569
569
  "pointer": "#/",
570
570
  "reportOnKey": true,
571
571
  "source": "foobar.yaml",
@@ -574,12 +574,12 @@ describe('Oas3.1 spec', () => {
574
574
  "message": "Must contain at least one of the following fields: paths, components, webhooks.",
575
575
  "ruleId": "spec",
576
576
  "severity": "error",
577
- "suggest": Array [],
577
+ "suggest": [],
578
578
  },
579
- Object {
579
+ {
580
580
  "from": undefined,
581
- "location": Array [
582
- Object {
581
+ "location": [
582
+ {
583
583
  "pointer": "#/info",
584
584
  "reportOnKey": true,
585
585
  "source": "foobar.yaml",
@@ -588,12 +588,12 @@ describe('Oas3.1 spec', () => {
588
588
  "message": "The field \`title\` must be present on this level.",
589
589
  "ruleId": "spec",
590
590
  "severity": "error",
591
- "suggest": Array [],
591
+ "suggest": [],
592
592
  },
593
- Object {
593
+ {
594
594
  "from": undefined,
595
- "location": Array [
596
- Object {
595
+ "location": [
596
+ {
597
597
  "pointer": "#/info",
598
598
  "reportOnKey": true,
599
599
  "source": "foobar.yaml",
@@ -602,7 +602,7 @@ describe('Oas3.1 spec', () => {
602
602
  "message": "The field \`version\` must be present on this level.",
603
603
  "ruleId": "spec",
604
604
  "severity": "error",
605
- "suggest": Array [],
605
+ "suggest": [],
606
606
  },
607
607
  ]
608
608
  `);
@@ -23,10 +23,10 @@ describe('Oas3 tag-description', () => {
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": "#/tags/0/description",
31
31
  "reportOnKey": true,
32
32
  "source": "foobar.yaml",
@@ -35,7 +35,7 @@ describe('Oas3 tag-description', () => {
35
35
  "message": "Tag object should contain \`description\` field.",
36
36
  "ruleId": "tag-description",
37
37
  "severity": "error",
38
- "suggest": Array [],
38
+ "suggest": [],
39
39
  },
40
40
  ]
41
41
  `);
@@ -60,6 +60,6 @@ describe('Oas3 tag-description', () => {
60
60
  config: await makeConfig({ 'tag-description': 'error' }),
61
61
  });
62
62
 
63
- expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
63
+ expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
64
64
  });
65
65
  });