@redocly/openapi-core 1.0.0-beta.105 → 1.0.0-beta.106

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 (189) hide show
  1. package/README.md +4 -4
  2. package/__tests__/utils.ts +5 -5
  3. package/lib/benchmark/benches/recommended-oas3.bench.js +1 -1
  4. package/lib/benchmark/utils.d.ts +2 -2
  5. package/lib/benchmark/utils.js +2 -2
  6. package/lib/bundle.d.ts +2 -2
  7. package/lib/bundle.js +2 -2
  8. package/lib/config/all.d.ts +2 -2
  9. package/lib/config/all.js +1 -1
  10. package/lib/config/builtIn.d.ts +2 -2
  11. package/lib/config/builtIn.js +2 -2
  12. package/lib/config/config-resolvers.d.ts +5 -5
  13. package/lib/config/config-resolvers.js +39 -36
  14. package/lib/config/config.d.ts +5 -5
  15. package/lib/config/config.js +4 -4
  16. package/lib/config/load.js +4 -4
  17. package/lib/config/minimal.d.ts +2 -2
  18. package/lib/config/minimal.js +1 -1
  19. package/lib/config/recommended.d.ts +2 -2
  20. package/lib/config/recommended.js +1 -1
  21. package/lib/config/rules.d.ts +2 -2
  22. package/lib/config/rules.js +1 -1
  23. package/lib/config/types.d.ts +23 -19
  24. package/lib/config/utils.d.ts +5 -5
  25. package/lib/config/utils.js +43 -26
  26. package/lib/decorators/common/remove-x-internal.js +2 -2
  27. package/lib/format/format.js +1 -1
  28. package/lib/index.d.ts +1 -1
  29. package/lib/index.js +2 -2
  30. package/lib/js-yaml/index.js +1 -6
  31. package/lib/lint.d.ts +2 -2
  32. package/lib/lint.js +16 -6
  33. package/lib/redocly/registry-api.d.ts +1 -1
  34. package/lib/redocly/registry-api.js +2 -2
  35. package/lib/rules/common/info-license-url.d.ts +1 -1
  36. package/lib/rules/common/info-license-url.js +5 -10
  37. package/lib/rules/common/info-license.d.ts +2 -0
  38. package/lib/rules/common/info-license.js +17 -0
  39. package/lib/rules/common/no-enum-type-mismatch.js +1 -3
  40. package/lib/rules/common/operation-operationId.js +1 -1
  41. package/lib/rules/common/path-not-include-query.js +1 -1
  42. package/lib/rules/common/paths-kebab-case.js +4 -1
  43. package/lib/rules/common/spec.js +1 -1
  44. package/lib/rules/oas2/index.js +4 -4
  45. package/lib/rules/oas2/remove-unused-components.js +3 -3
  46. package/lib/rules/oas3/index.js +4 -4
  47. package/lib/rules/oas3/no-empty-servers.js +1 -1
  48. package/lib/rules/oas3/remove-unused-components.js +2 -2
  49. package/lib/rules/other/stats.js +43 -14
  50. package/lib/rules/utils.d.ts +1 -1
  51. package/lib/rules/utils.js +4 -1
  52. package/lib/types/index.d.ts +2 -2
  53. package/lib/types/redocly-yaml.js +8 -7
  54. package/package.json +1 -1
  55. package/src/__tests__/__snapshots__/bundle.test.ts.snap +141 -0
  56. package/src/__tests__/bundle.test.ts +68 -34
  57. package/src/__tests__/codeframes.test.ts +13 -14
  58. package/src/__tests__/js-yaml.test.ts +6 -4
  59. package/src/__tests__/lint.test.ts +74 -6
  60. package/src/__tests__/login.test.ts +2 -2
  61. package/src/__tests__/normalizeVisitors.test.ts +4 -4
  62. package/src/__tests__/ref-utils.test.ts +13 -13
  63. package/src/__tests__/resolve-http.test.ts +1 -1
  64. package/src/__tests__/resolve.test.ts +14 -11
  65. package/src/__tests__/walk.test.ts +48 -56
  66. package/src/benchmark/benches/lint-with-many-rules.bench.ts +1 -1
  67. package/src/benchmark/benches/lint-with-nested-rule.bench.ts +1 -1
  68. package/src/benchmark/benches/lint-with-no-rules.bench.ts +1 -1
  69. package/src/benchmark/benches/lint-with-top-level-rule-report.bench.ts +1 -1
  70. package/src/benchmark/benches/lint-with-top-level-rule.bench.ts +1 -1
  71. package/src/benchmark/benches/recommended-oas3.bench.ts +3 -3
  72. package/src/benchmark/benches/resolve-with-no-external.bench.ts +1 -1
  73. package/src/benchmark/benchmark.js +9 -5
  74. package/src/benchmark/utils.ts +5 -5
  75. package/src/bundle.ts +18 -17
  76. package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +1 -1
  77. package/src/config/__tests__/config-resolvers.test.ts +123 -121
  78. package/src/config/__tests__/config.test.ts +76 -76
  79. package/src/config/__tests__/fixtures/resolve-config/api/plugin.js +4 -2
  80. package/src/config/__tests__/fixtures/resolve-config/plugin.js +4 -1
  81. package/src/config/__tests__/resolve-plugins.test.ts +3 -3
  82. package/src/config/__tests__/utils.test.ts +83 -0
  83. package/src/config/all.ts +3 -4
  84. package/src/config/builtIn.ts +5 -5
  85. package/src/config/config-resolvers.ts +122 -83
  86. package/src/config/config.ts +5 -5
  87. package/src/config/load.ts +6 -6
  88. package/src/config/minimal.ts +3 -3
  89. package/src/config/recommended.ts +3 -3
  90. package/src/config/rules.ts +6 -6
  91. package/src/config/types.ts +28 -19
  92. package/src/config/utils.ts +70 -50
  93. package/src/decorators/__tests__/filter-out.test.ts +8 -4
  94. package/src/decorators/__tests__/remove-x-internal.test.ts +5 -5
  95. package/src/decorators/common/filters/filter-helper.ts +1 -1
  96. package/src/decorators/common/info-description-override.ts +1 -1
  97. package/src/decorators/common/operation-description-override.ts +1 -1
  98. package/src/decorators/common/remove-x-internal.ts +4 -4
  99. package/src/decorators/common/tag-description-override.ts +1 -1
  100. package/src/format/codeframes.ts +4 -4
  101. package/src/format/format.ts +10 -10
  102. package/src/index.ts +2 -3
  103. package/src/js-yaml/index.ts +3 -8
  104. package/src/lint.ts +22 -18
  105. package/src/oas-types.ts +1 -6
  106. package/src/redocly/__tests__/redocly-client.test.ts +25 -19
  107. package/src/redocly/index.ts +6 -4
  108. package/src/redocly/registry-api.ts +6 -6
  109. package/src/ref-utils.ts +2 -2
  110. package/src/resolve.ts +7 -4
  111. package/src/rules/__tests__/no-unresolved-refs.test.ts +4 -4
  112. package/src/rules/__tests__/utils.test.ts +122 -0
  113. package/src/rules/ajv.ts +3 -4
  114. package/src/rules/common/__tests__/info-description.test.ts +3 -3
  115. package/src/rules/common/__tests__/info-license.test.ts +2 -2
  116. package/src/rules/common/__tests__/license-url.test.ts +2 -2
  117. package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +1 -1
  118. package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +8 -8
  119. package/src/rules/common/__tests__/no-identical-paths.test.ts +1 -1
  120. package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +3 -3
  121. package/src/rules/common/__tests__/operation-2xx-response.test.ts +3 -3
  122. package/src/rules/common/__tests__/operation-4xx-response.test.ts +3 -3
  123. package/src/rules/common/__tests__/operation-operationId-unique.test.ts +2 -2
  124. package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +1 -1
  125. package/src/rules/common/__tests__/operation-parameters-unique.test.ts +4 -4
  126. package/src/rules/common/__tests__/operation-security-defined.test.ts +2 -2
  127. package/src/rules/common/__tests__/operation-singular-tag.test.ts +2 -2
  128. package/src/rules/common/__tests__/path-http-verbs-order.test.ts +2 -2
  129. package/src/rules/common/__tests__/path-not-include-query.test.ts +2 -2
  130. package/src/rules/common/__tests__/path-params-defined.test.ts +3 -3
  131. package/src/rules/common/__tests__/paths-kebab-case.test.ts +15 -15
  132. package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +8 -8
  133. package/src/rules/common/__tests__/spec.test.ts +2 -2
  134. package/src/rules/common/__tests__/tag-description.test.ts +2 -2
  135. package/src/rules/common/__tests__/tags-alphabetical.test.ts +2 -2
  136. package/src/rules/common/assertions/__tests__/asserts.test.ts +513 -130
  137. package/src/rules/common/assertions/index.ts +6 -6
  138. package/src/rules/common/info-license-url.ts +4 -9
  139. package/src/rules/common/info-license.ts +15 -0
  140. package/src/rules/common/no-ambiguous-paths.ts +1 -1
  141. package/src/rules/common/no-enum-type-mismatch.ts +12 -9
  142. package/src/rules/common/no-invalid-parameter-examples.ts +2 -2
  143. package/src/rules/common/no-invalid-schema-examples.ts +1 -1
  144. package/src/rules/common/operation-operationId.ts +1 -1
  145. package/src/rules/common/operation-parameters-unique.ts +2 -2
  146. package/src/rules/common/path-not-include-query.ts +1 -1
  147. package/src/rules/common/path-params-defined.ts +1 -1
  148. package/src/rules/common/paths-kebab-case.ts +4 -1
  149. package/src/rules/common/scalar-property-missing-example.ts +1 -1
  150. package/src/rules/common/spec.ts +10 -7
  151. package/src/rules/no-unresolved-refs.ts +1 -1
  152. package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +3 -3
  153. package/src/rules/oas2/__tests__/spec/info.test.ts +12 -12
  154. package/src/rules/oas2/__tests__/spec/operation.test.ts +4 -4
  155. package/src/rules/oas2/__tests__/spec/paths.test.ts +10 -10
  156. package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +6 -2
  157. package/src/rules/oas2/__tests__/spec/utils.ts +6 -6
  158. package/src/rules/oas2/index.ts +3 -3
  159. package/src/rules/oas2/remove-unused-components.ts +13 -8
  160. package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +3 -3
  161. package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +2 -2
  162. package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +8 -8
  163. package/src/rules/oas3/__tests__/no-server-example.com.test.ts +2 -2
  164. package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +3 -3
  165. package/src/rules/oas3/__tests__/no-unused-components.test.ts +1 -1
  166. package/src/rules/oas3/__tests__/spec/callbacks.test.ts +1 -1
  167. package/src/rules/oas3/__tests__/spec/info.test.ts +12 -12
  168. package/src/rules/oas3/__tests__/spec/operation.test.ts +8 -8
  169. package/src/rules/oas3/__tests__/spec/paths.test.ts +10 -10
  170. package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +12 -12
  171. package/src/rules/oas3/__tests__/spec/servers.test.ts +15 -15
  172. package/src/rules/oas3/__tests__/spec/spec.test.ts +6 -6
  173. package/src/rules/oas3/__tests__/spec/utils.ts +6 -6
  174. package/src/rules/oas3/index.ts +3 -3
  175. package/src/rules/oas3/no-empty-servers.ts +1 -1
  176. package/src/rules/oas3/no-invalid-media-type-examples.ts +12 -4
  177. package/src/rules/oas3/no-servers-empty-enum.ts +9 -10
  178. package/src/rules/oas3/remove-unused-components.ts +18 -7
  179. package/src/rules/other/stats.ts +46 -17
  180. package/src/rules/utils.ts +5 -3
  181. package/src/types/index.ts +5 -5
  182. package/src/types/redocly-yaml.ts +8 -7
  183. package/src/typings/common.ts +9 -1
  184. package/src/typings/openapi.ts +1 -1
  185. package/src/visitors.ts +4 -4
  186. package/tsconfig.tsbuildinfo +1 -1
  187. package/lib/rules/common/license-url.d.ts +0 -2
  188. package/lib/rules/common/license-url.js +0 -12
  189. package/src/rules/common/license-url.ts +0 -10
@@ -4,9 +4,16 @@ import { Oas2Components } from '../../typings/swagger';
4
4
  import { isEmptyObject } from '../../utils';
5
5
 
6
6
  export const RemoveUnusedComponents: Oas2Rule = () => {
7
- let components = new Map<string, { used: boolean; componentType?: keyof Oas2Components; name: string }>();
7
+ let components = new Map<
8
+ string,
9
+ { used: boolean; componentType?: keyof Oas2Components; name: string }
10
+ >();
8
11
 
9
- function registerComponent(location: Location, componentType: keyof Oas2Components, name: string): void {
12
+ function registerComponent(
13
+ location: Location,
14
+ componentType: keyof Oas2Components,
15
+ name: string
16
+ ): void {
10
17
  components.set(location.absolutePointer, {
11
18
  used: components.get(location.absolutePointer)?.used || false,
12
19
  componentType,
@@ -17,9 +24,7 @@ export const RemoveUnusedComponents: Oas2Rule = () => {
17
24
  return {
18
25
  ref: {
19
26
  leave(ref, { type, resolve, key }) {
20
- if (
21
- ['Schema', 'Parameter', 'Response', 'SecurityScheme'].includes(type.name)
22
- ) {
27
+ if (['Schema', 'Parameter', 'Response', 'SecurityScheme'].includes(type.name)) {
23
28
  const resolvedRef = resolve(ref);
24
29
  if (!resolvedRef.location) return;
25
30
  components.set(resolvedRef.location.absolutePointer, {
@@ -27,7 +32,7 @@ export const RemoveUnusedComponents: Oas2Rule = () => {
27
32
  name: key.toString(),
28
33
  });
29
34
  }
30
- }
35
+ },
31
36
  },
32
37
  DefinitionRoot: {
33
38
  leave(root, ctx) {
@@ -35,7 +40,7 @@ export const RemoveUnusedComponents: Oas2Rule = () => {
35
40
  data.removedCount = 0;
36
41
 
37
42
  let rootComponents = new Set<keyof Oas2Components>();
38
- components.forEach(usageInfo => {
43
+ components.forEach((usageInfo) => {
39
44
  const { used, name, componentType } = usageInfo;
40
45
  if (!used && componentType) {
41
46
  rootComponents.add(componentType);
@@ -71,6 +76,6 @@ export const RemoveUnusedComponents: Oas2Rule = () => {
71
76
  SecurityScheme(_securityScheme, { location, key }) {
72
77
  registerComponent(location, 'securityDefinitions', key.toString());
73
78
  },
74
- }
79
+ },
75
80
  };
76
81
  };
@@ -16,7 +16,7 @@ describe('oas3 boolean-parameter-prefixes', () => {
16
16
  schema:
17
17
  type: boolean
18
18
  `,
19
- 'foobar.yaml',
19
+ 'foobar.yaml'
20
20
  );
21
21
 
22
22
  const results = await lintDocument({
@@ -68,7 +68,7 @@ describe('oas3 boolean-parameter-prefixes', () => {
68
68
  schema:
69
69
  type: boolean
70
70
  `,
71
- 'foobar.yaml',
71
+ 'foobar.yaml'
72
72
  );
73
73
 
74
74
  const results = await lintDocument({
@@ -92,7 +92,7 @@ describe('oas3 boolean-parameter-prefixes', () => {
92
92
  schema:
93
93
  type: boolean
94
94
  `,
95
- 'foobar.yaml',
95
+ 'foobar.yaml'
96
96
  );
97
97
 
98
98
  const results = await lintDocument({
@@ -14,7 +14,7 @@ describe('Oas3 oas3-no-example-value-and-externalValue', () => {
14
14
  value: 12
15
15
  externalValue: https://1.1.1.1
16
16
  `,
17
- 'foobar.yaml',
17
+ 'foobar.yaml'
18
18
  );
19
19
 
20
20
  const results = await lintDocument({
@@ -51,7 +51,7 @@ describe('Oas3 oas3-no-example-value-and-externalValue', () => {
51
51
  some:
52
52
  value: 12
53
53
  `,
54
- 'foobar.yaml',
54
+ 'foobar.yaml'
55
55
  );
56
56
 
57
57
  const results = await lintDocument({
@@ -27,7 +27,7 @@ describe('no-invalid-media-type-examples', () => {
27
27
  type: number
28
28
 
29
29
  `,
30
- 'foobar.yaml',
30
+ 'foobar.yaml'
31
31
  );
32
32
 
33
33
  const results = await lintDocument({
@@ -100,7 +100,7 @@ describe('no-invalid-media-type-examples', () => {
100
100
  type: number
101
101
 
102
102
  `,
103
- 'foobar.yaml',
103
+ 'foobar.yaml'
104
104
  );
105
105
 
106
106
  const results = await lintDocument({
@@ -160,7 +160,7 @@ describe('no-invalid-media-type-examples', () => {
160
160
  type: number
161
161
 
162
162
  `,
163
- 'foobar.yaml',
163
+ 'foobar.yaml'
164
164
  );
165
165
 
166
166
  const results = await lintDocument({
@@ -210,7 +210,7 @@ describe('no-invalid-media-type-examples', () => {
210
210
  type: number
211
211
 
212
212
  `,
213
- 'foobar.yaml',
213
+ 'foobar.yaml'
214
214
  );
215
215
 
216
216
  const results = await lintDocument({
@@ -263,7 +263,7 @@ describe('no-invalid-media-type-examples', () => {
263
263
  b: 35
264
264
 
265
265
  `,
266
- 'foobar.yaml',
266
+ 'foobar.yaml'
267
267
  );
268
268
 
269
269
  const results = await lintDocument({
@@ -295,7 +295,7 @@ describe('no-invalid-media-type-examples', () => {
295
295
  type: number
296
296
 
297
297
  `,
298
- 'foobar.yaml',
298
+ 'foobar.yaml'
299
299
  );
300
300
 
301
301
  const results = await lintDocument({
@@ -330,7 +330,7 @@ describe('no-invalid-media-type-examples', () => {
330
330
  $ref: '#/components/schemas/C'
331
331
 
332
332
  `,
333
- __dirname + '/foobar.yaml',
333
+ __dirname + '/foobar.yaml'
334
334
  );
335
335
 
336
336
  const results = await lintDocument({
@@ -358,7 +358,7 @@ describe('no-invalid-media-type-examples', () => {
358
358
  nullable: true
359
359
 
360
360
  `,
361
- 'foobar.yaml',
361
+ 'foobar.yaml'
362
362
  );
363
363
 
364
364
  const results = await lintDocument({
@@ -11,7 +11,7 @@ describe('Oas3 oas3-no-server-example.com', () => {
11
11
  servers:
12
12
  - url: example.com
13
13
  `,
14
- 'foobar.yaml',
14
+ 'foobar.yaml'
15
15
  );
16
16
 
17
17
  const results = await lintDocument({
@@ -46,7 +46,7 @@ describe('Oas3 oas3-no-server-example.com', () => {
46
46
  servers:
47
47
  - url: not-example.com
48
48
  `,
49
- 'foobar.yaml',
49
+ 'foobar.yaml'
50
50
  );
51
51
 
52
52
  const results = await lintDocument({
@@ -11,7 +11,7 @@ describe('Oas3 oas3-no-server-trailing-slash', () => {
11
11
  servers:
12
12
  - url: https://somedomain.com/
13
13
  `,
14
- 'foobar.yaml',
14
+ 'foobar.yaml'
15
15
  );
16
16
 
17
17
  const results = await lintDocument({
@@ -46,7 +46,7 @@ describe('Oas3 oas3-no-server-trailing-slash', () => {
46
46
  servers:
47
47
  - url: https://somedomain.com
48
48
  `,
49
- 'foobar.yaml',
49
+ 'foobar.yaml'
50
50
  );
51
51
 
52
52
  const results = await lintDocument({
@@ -65,7 +65,7 @@ describe('Oas3 oas3-no-server-trailing-slash', () => {
65
65
  servers:
66
66
  - url: /
67
67
  `,
68
- 'foobar.yaml',
68
+ 'foobar.yaml'
69
69
  );
70
70
 
71
71
  const results = await lintDocument({
@@ -36,7 +36,7 @@ describe('Oas3 no-unused-components', () => {
36
36
  - 1
37
37
  - 2
38
38
  `,
39
- 'foobar.yaml',
39
+ 'foobar.yaml'
40
40
  );
41
41
 
42
42
  const results = await lintDocument({
@@ -36,6 +36,6 @@ it('should not fail on valid callbacks object', async () => {
36
36
  expect(
37
37
  await validateDoc(source, {
38
38
  spec: 'error',
39
- }),
39
+ })
40
40
  ).toMatchInlineSnapshot(`Array []`);
41
41
  });
@@ -23,7 +23,7 @@ describe('OpenAPI Schema', () => {
23
23
  expect(
24
24
  await validateDoc(source, {
25
25
  spec: 'error',
26
- }),
26
+ })
27
27
  ).toMatchInlineSnapshot(`
28
28
  Array [
29
29
  Object {
@@ -56,7 +56,7 @@ describe('OpenAPI Schema', () => {
56
56
  expect(
57
57
  await validateDoc(source, {
58
58
  spec: 'error',
59
- }),
59
+ })
60
60
  ).toMatchInlineSnapshot(`
61
61
  Array [
62
62
  Object {
@@ -89,7 +89,7 @@ describe('OpenAPI Schema', () => {
89
89
  expect(
90
90
  await validateDoc(source, {
91
91
  spec: 'error',
92
- }),
92
+ })
93
93
  ).toMatchInlineSnapshot(`
94
94
  Array [
95
95
  Object {
@@ -126,7 +126,7 @@ describe('OpenAPI Schema', () => {
126
126
  expect(
127
127
  await validateDoc(source, {
128
128
  spec: 'error',
129
- }),
129
+ })
130
130
  ).toMatchInlineSnapshot(`Array []`);
131
131
  });
132
132
 
@@ -155,7 +155,7 @@ describe('OpenAPI Schema', () => {
155
155
  expect(
156
156
  await validateDoc(source, {
157
157
  spec: 'error',
158
- }),
158
+ })
159
159
  ).toMatchInlineSnapshot(`
160
160
  Array [
161
161
  Object {
@@ -191,7 +191,7 @@ describe('OpenAPI Schema', () => {
191
191
  expect(
192
192
  await validateDoc(source, {
193
193
  spec: 'error',
194
- }),
194
+ })
195
195
  ).toMatchInlineSnapshot(`
196
196
  Array [
197
197
  Object {
@@ -226,7 +226,7 @@ describe('OpenAPI Schema', () => {
226
226
  expect(
227
227
  await validateDoc(source, {
228
228
  spec: 'error',
229
- }),
229
+ })
230
230
  ).toMatchInlineSnapshot(`Array []`);
231
231
  });
232
232
 
@@ -253,7 +253,7 @@ describe('OpenAPI Schema', () => {
253
253
  expect(
254
254
  await validateDoc(source, {
255
255
  spec: 'error',
256
- }),
256
+ })
257
257
  ).toMatchInlineSnapshot(`
258
258
  Array [
259
259
  Object {
@@ -288,7 +288,7 @@ describe('OpenAPI Schema', () => {
288
288
  expect(
289
289
  await validateDoc(source, {
290
290
  spec: 'error',
291
- }),
291
+ })
292
292
  ).toMatchInlineSnapshot(`
293
293
  Array [
294
294
  Object {
@@ -322,7 +322,7 @@ describe('OpenAPI Schema', () => {
322
322
  expect(
323
323
  await validateDoc(source, {
324
324
  spec: 'error',
325
- }),
325
+ })
326
326
  ).toMatchInlineSnapshot(`Array []`);
327
327
  });
328
328
 
@@ -346,7 +346,7 @@ describe('OpenAPI Schema', () => {
346
346
  expect(
347
347
  await validateDoc(source, {
348
348
  spec: 'error',
349
- }),
349
+ })
350
350
  ).toMatchInlineSnapshot(`
351
351
  Array [
352
352
  Object {
@@ -378,7 +378,7 @@ describe('OpenAPI Schema', () => {
378
378
  expect(
379
379
  await validateDoc(source, {
380
380
  spec: 'error',
381
- }),
381
+ })
382
382
  ).toMatchInlineSnapshot(`
383
383
  Array [
384
384
  Object {
@@ -23,7 +23,7 @@ it('should not report if summary field is valid', async () => {
23
23
  expect(
24
24
  await validateDoc(source, {
25
25
  spec: 'error',
26
- }),
26
+ })
27
27
  ).toMatchInlineSnapshot(`Array []`);
28
28
  });
29
29
 
@@ -49,7 +49,7 @@ it('should report if summary field is not string ', async () => {
49
49
  expect(
50
50
  await validateDoc(source, {
51
51
  spec: 'error',
52
- }),
52
+ })
53
53
  ).toMatchInlineSnapshot(`
54
54
  Array [
55
55
  Object {
@@ -82,7 +82,7 @@ it('should not report if description field is valid', async () => {
82
82
  expect(
83
83
  await validateDoc(source, {
84
84
  spec: 'error',
85
- }),
85
+ })
86
86
  ).toMatchInlineSnapshot(`Array []`);
87
87
  });
88
88
 
@@ -108,7 +108,7 @@ it('should report if description field is not string', async () => {
108
108
  expect(
109
109
  await validateDoc(source, {
110
110
  spec: 'error',
111
- }),
111
+ })
112
112
  ).toMatchInlineSnapshot(`
113
113
  Array [
114
114
  Object {
@@ -140,7 +140,7 @@ it('should not report of a valid GET operation object', async () => {
140
140
  expect(
141
141
  await validateDoc(source, {
142
142
  spec: 'error',
143
- }),
143
+ })
144
144
  ).toMatchInlineSnapshot(`Array []`);
145
145
  });
146
146
 
@@ -170,7 +170,7 @@ it('should not report of a valid PUT operation object', async () => {
170
170
  expect(
171
171
  await validateDoc(source, {
172
172
  spec: 'error',
173
- }),
173
+ })
174
174
  ).toMatchInlineSnapshot(`Array []`);
175
175
  });
176
176
 
@@ -208,7 +208,7 @@ it('should not report of a valid Post operation object', async () => {
208
208
  expect(
209
209
  await validateDoc(source, {
210
210
  spec: 'error',
211
- }),
211
+ })
212
212
  ).toMatchInlineSnapshot(`Array []`);
213
213
  });
214
214
 
@@ -248,6 +248,6 @@ it('should not report of a valid delete operation object', async () => {
248
248
  expect(
249
249
  await validateDoc(source, {
250
250
  spec: 'error',
251
- }),
251
+ })
252
252
  ).toMatchInlineSnapshot(`Array []`);
253
253
  });
@@ -23,7 +23,7 @@ describe('OpenAPI Schema', () => {
23
23
  expect(
24
24
  await validateDoc(source, {
25
25
  spec: 'error',
26
- }),
26
+ })
27
27
  ).toMatchInlineSnapshot(`Array []`);
28
28
  });
29
29
 
@@ -43,7 +43,7 @@ describe('OpenAPI Schema', () => {
43
43
  expect(
44
44
  await validateDoc(source, {
45
45
  spec: 'error',
46
- }),
46
+ })
47
47
  ).toMatchInlineSnapshot(`Array []`);
48
48
  });
49
49
 
@@ -61,7 +61,7 @@ describe('OpenAPI Schema', () => {
61
61
  expect(
62
62
  await validateDoc(source, {
63
63
  spec: 'error',
64
- }),
64
+ })
65
65
  ).toMatchInlineSnapshot(`
66
66
  Array [
67
67
  Object {
@@ -88,7 +88,7 @@ describe('OpenAPI Schema', () => {
88
88
  expect(
89
89
  await validateDoc(source, {
90
90
  spec: 'error',
91
- }),
91
+ })
92
92
  ).toMatchInlineSnapshot(`Array []`);
93
93
  });
94
94
 
@@ -114,7 +114,7 @@ describe('OpenAPI Schema', () => {
114
114
  expect(
115
115
  await validateDoc(source, {
116
116
  spec: 'error',
117
- }),
117
+ })
118
118
  ).toMatchInlineSnapshot(`
119
119
  Array [
120
120
  Object {
@@ -151,7 +151,7 @@ describe('OpenAPI Schema', () => {
151
151
  expect(
152
152
  await validateDoc(source, {
153
153
  'no-identical-paths': 'error',
154
- }),
154
+ })
155
155
  ).toMatchInlineSnapshot(`
156
156
  Array [
157
157
  Object {
@@ -188,7 +188,7 @@ describe('OpenAPI Schema', () => {
188
188
  expect(
189
189
  await validateDoc(source, {
190
190
  spec: 'error',
191
- }),
191
+ })
192
192
  ).toMatchInlineSnapshot(`Array []`);
193
193
  });
194
194
 
@@ -218,7 +218,7 @@ describe('OpenAPI Schema', () => {
218
218
  expect(
219
219
  await validateDoc(source, {
220
220
  spec: 'error',
221
- }),
221
+ })
222
222
  ).toMatchInlineSnapshot(`Array []`);
223
223
  });
224
224
 
@@ -239,7 +239,7 @@ describe('OpenAPI Schema', () => {
239
239
  expect(
240
240
  await validateDoc(source, {
241
241
  spec: 'error',
242
- }),
242
+ })
243
243
  ).toMatchInlineSnapshot(`Array []`);
244
244
  });
245
245
 
@@ -278,7 +278,7 @@ describe('OpenAPI Schema', () => {
278
278
  expect(
279
279
  await validateDoc(source, {
280
280
  spec: 'error',
281
- }),
281
+ })
282
282
  ).toMatchInlineSnapshot(`Array []`);
283
283
  });
284
284
  });
@@ -1,9 +1,9 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { parseYamlToDocument, replaceSourceWithRef } from '../../../../../__tests__/utils';
3
3
  import { lintDocument } from '../../../../lint';
4
- import { LintConfig } from '../../../..';
4
+ import { StyleguideConfig } from '../../../..';
5
5
  import { BaseResolver } from '../../../../resolve';
6
- import { resolveLint } from '../../../../config';
6
+ import { resolveStyleguideConfig } from '../../../../config';
7
7
 
8
8
  describe('Referenceable scalars', () => {
9
9
  it('should not report $ref description', async () => {
@@ -17,22 +17,22 @@ describe('Referenceable scalars', () => {
17
17
  $ref: fixtures/description.md
18
18
  paths: {}
19
19
  `,
20
- __dirname + '/foobar.yaml',
20
+ __dirname + '/foobar.yaml'
21
21
  );
22
22
 
23
23
  const results = await lintDocument({
24
24
  externalRefResolver: new BaseResolver(),
25
25
  document,
26
- config: new LintConfig(
27
- await resolveLint({
28
- lintConfig: {
26
+ config: new StyleguideConfig(
27
+ await resolveStyleguideConfig({
28
+ styleguideConfig: {
29
29
  extends: [],
30
30
  rules: {
31
31
  spec: 'error',
32
32
  'no-unresolved-refs': 'error',
33
33
  },
34
34
  },
35
- }),
35
+ })
36
36
  ),
37
37
  });
38
38
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
@@ -54,22 +54,22 @@ describe('Referenceable scalars', () => {
54
54
  example:
55
55
  $ref: not $ref, example
56
56
  `,
57
- __dirname + '/foobar.yaml',
57
+ __dirname + '/foobar.yaml'
58
58
  );
59
59
 
60
60
  const results = await lintDocument({
61
61
  externalRefResolver: new BaseResolver(),
62
62
  document,
63
- config: new LintConfig(
64
- await resolveLint({
65
- lintConfig: {
63
+ config: new StyleguideConfig(
64
+ await resolveStyleguideConfig({
65
+ styleguideConfig: {
66
66
  extends: [],
67
67
  rules: {
68
68
  'no-unresolved-refs': 'error',
69
69
  },
70
70
  doNotResolveExamples: true,
71
71
  },
72
- }),
72
+ })
73
73
  ),
74
74
  });
75
75
  expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`Array []`);
@@ -24,7 +24,7 @@ describe('OpenAPI Schema', () => {
24
24
  expect(
25
25
  await validateDoc(source, {
26
26
  spec: 'error',
27
- }),
27
+ })
28
28
  ).toMatchInlineSnapshot(`Array []`);
29
29
  });
30
30
 
@@ -49,7 +49,7 @@ describe('OpenAPI Schema', () => {
49
49
  expect(
50
50
  await validateDoc(source, {
51
51
  spec: 'error',
52
- }),
52
+ })
53
53
  ).toMatchInlineSnapshot(`
54
54
  Array [
55
55
  Object {
@@ -81,7 +81,7 @@ describe('OpenAPI Schema', () => {
81
81
  expect(
82
82
  await validateDoc(source, {
83
83
  spec: 'error',
84
- }),
84
+ })
85
85
  ).toMatchInlineSnapshot(`
86
86
  Array [
87
87
  Object {
@@ -114,7 +114,7 @@ describe('OpenAPI Schema', () => {
114
114
  expect(
115
115
  await validateDoc(source, {
116
116
  spec: 'error',
117
- }),
117
+ })
118
118
  ).toMatchInlineSnapshot(`
119
119
  Array [
120
120
  Object {
@@ -146,7 +146,7 @@ describe('OpenAPI Schema', () => {
146
146
  expect(
147
147
  await validateDoc(source, {
148
148
  spec: 'error',
149
- }),
149
+ })
150
150
  ).toMatchInlineSnapshot(`Array []`);
151
151
  });
152
152
 
@@ -171,7 +171,7 @@ describe('OpenAPI Schema', () => {
171
171
  expect(
172
172
  await validateDoc(source, {
173
173
  spec: 'error',
174
- }),
174
+ })
175
175
  ).toMatchInlineSnapshot(`
176
176
  Array [
177
177
  Object {
@@ -208,7 +208,7 @@ describe('OpenAPI Schema', () => {
208
208
  expect(
209
209
  await validateDoc(source, {
210
210
  spec: 'error',
211
- }),
211
+ })
212
212
  ).toMatchInlineSnapshot(`Array []`);
213
213
  });
214
214
 
@@ -243,7 +243,7 @@ describe('OpenAPI Schema', () => {
243
243
  expect(
244
244
  await validateDoc(source, {
245
245
  spec: 'error',
246
- }),
246
+ })
247
247
  ).toMatchInlineSnapshot(`Array []`);
248
248
  });
249
249
 
@@ -277,7 +277,7 @@ describe('OpenAPI Schema', () => {
277
277
  expect(
278
278
  await validateDoc(source, {
279
279
  spec: 'error',
280
- }),
280
+ })
281
281
  ).toMatchInlineSnapshot(`
282
282
  Array [
283
283
  Object {
@@ -317,7 +317,7 @@ describe('OpenAPI Schema', () => {
317
317
  expect(
318
318
  await validateDoc(source, {
319
319
  'no-undefined-server-variable': 'error',
320
- }),
320
+ })
321
321
  ).toMatchInlineSnapshot(`
322
322
  Array [
323
323
  Object {
@@ -357,7 +357,7 @@ describe('OpenAPI Schema', () => {
357
357
  expect(
358
358
  await validateDoc(source, {
359
359
  spec: 'error',
360
- }),
360
+ })
361
361
  ).toMatchInlineSnapshot(`
362
362
  Array [
363
363
  Object {
@@ -403,7 +403,7 @@ describe('OpenAPI Schema', () => {
403
403
  expect(
404
404
  await validateDoc(source, {
405
405
  spec: 'error',
406
- }),
406
+ })
407
407
  ).toMatchInlineSnapshot(`
408
408
  Array [
409
409
  Object {
@@ -447,7 +447,7 @@ describe('OpenAPI Schema', () => {
447
447
  expect(
448
448
  await validateDoc(source, {
449
449
  spec: 'error',
450
- }),
450
+ })
451
451
  ).toMatchInlineSnapshot(`Array []`);
452
452
  });
453
453
 
@@ -469,7 +469,7 @@ describe('OpenAPI Schema', () => {
469
469
  expect(
470
470
  await validateDoc(source, {
471
471
  spec: 'error',
472
- }),
472
+ })
473
473
  ).toMatchInlineSnapshot(`Array []`);
474
474
  });
475
475
 
@@ -493,7 +493,7 @@ describe('OpenAPI Schema', () => {
493
493
  expect(
494
494
  await validateDoc(source, {
495
495
  spec: 'error',
496
- }),
496
+ })
497
497
  ).toMatchInlineSnapshot(`Array []`);
498
498
  });
499
499
  });