@redocly/openapi-core 1.0.0-beta.77 → 1.0.0-beta.81

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 (108) hide show
  1. package/__tests__/utils.ts +11 -1
  2. package/lib/bundle.d.ts +3 -1
  3. package/lib/bundle.js +30 -8
  4. package/lib/config/builtIn.js +18 -4
  5. package/lib/config/config.d.ts +2 -9
  6. package/lib/{rules → decorators}/common/info-description-override.d.ts +0 -0
  7. package/lib/{rules → decorators}/common/info-description-override.js +0 -0
  8. package/lib/{rules → decorators}/common/operation-description-override.d.ts +0 -0
  9. package/lib/{rules → decorators}/common/operation-description-override.js +0 -0
  10. package/lib/{rules → decorators}/common/registry-dependencies.d.ts +0 -0
  11. package/lib/{rules → decorators}/common/registry-dependencies.js +0 -0
  12. package/lib/decorators/common/remove-x-internal.d.ts +2 -0
  13. package/lib/decorators/common/remove-x-internal.js +58 -0
  14. package/lib/{rules → decorators}/common/tag-description-override.d.ts +0 -0
  15. package/lib/{rules → decorators}/common/tag-description-override.js +0 -0
  16. package/lib/decorators/oas2/index.d.ts +8 -0
  17. package/lib/decorators/oas2/index.js +15 -0
  18. package/lib/decorators/oas3/index.d.ts +8 -0
  19. package/lib/decorators/oas3/index.js +15 -0
  20. package/lib/js-yaml/index.js +1 -1
  21. package/lib/redocly/registry-api.js +4 -1
  22. package/lib/resolve.d.ts +1 -0
  23. package/lib/resolve.js +7 -3
  24. package/lib/rules/common/operation-security-defined.js +1 -4
  25. package/lib/rules/common/spec.js +18 -3
  26. package/lib/rules/oas2/index.d.ts +1 -7
  27. package/lib/rules/oas2/index.js +1 -11
  28. package/lib/rules/oas2/remove-unused-components.d.ts +2 -0
  29. package/lib/rules/oas2/remove-unused-components.js +73 -0
  30. package/lib/rules/oas3/index.d.ts +0 -7
  31. package/lib/rules/oas3/index.js +1 -11
  32. package/lib/rules/oas3/no-invalid-media-type-examples.js +12 -11
  33. package/lib/rules/oas3/remove-unused-components.d.ts +2 -0
  34. package/lib/rules/oas3/remove-unused-components.js +83 -0
  35. package/lib/types/index.d.ts +4 -0
  36. package/lib/types/oas2.js +42 -35
  37. package/lib/types/oas3.js +68 -139
  38. package/lib/types/oas3_1.js +52 -49
  39. package/lib/typings/swagger.d.ts +14 -0
  40. package/lib/utils.d.ts +2 -0
  41. package/lib/utils.js +10 -2
  42. package/lib/walk.js +5 -8
  43. package/package.json +1 -1
  44. package/src/__tests__/js-yaml.test.ts +29 -5
  45. package/src/__tests__/lint.test.ts +1 -3
  46. package/src/bundle.ts +37 -8
  47. package/src/config/builtIn.ts +20 -7
  48. package/src/config/config.ts +2 -3
  49. package/src/decorators/__tests__/remove-x-internal.test.ts +316 -0
  50. package/src/{rules → decorators}/common/info-description-override.ts +0 -0
  51. package/src/{rules → decorators}/common/operation-description-override.ts +0 -0
  52. package/src/{rules → decorators}/common/registry-dependencies.ts +0 -0
  53. package/src/decorators/common/remove-x-internal.ts +59 -0
  54. package/src/{rules → decorators}/common/tag-description-override.ts +0 -0
  55. package/src/decorators/oas2/index.ts +14 -0
  56. package/src/decorators/oas3/index.ts +14 -0
  57. package/src/js-yaml/index.ts +1 -2
  58. package/src/redocly/registry-api.ts +7 -1
  59. package/src/resolve.ts +6 -6
  60. package/src/rules/__tests__/no-unresolved-refs.test.ts +1 -4
  61. package/src/rules/common/__tests__/info-description.test.ts +1 -3
  62. package/src/rules/common/__tests__/info-license.test.ts +1 -2
  63. package/src/rules/common/__tests__/license-url.test.ts +1 -2
  64. package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +1 -2
  65. package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +1 -2
  66. package/src/rules/common/__tests__/no-identical-paths.test.ts +1 -2
  67. package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +1 -2
  68. package/src/rules/common/__tests__/operation-2xx-response.test.ts +1 -2
  69. package/src/rules/common/__tests__/operation-4xx-response.test.ts +1 -2
  70. package/src/rules/common/__tests__/operation-operationId-unique.test.ts +1 -2
  71. package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +1 -2
  72. package/src/rules/common/__tests__/operation-parameters-unique.test.ts +1 -2
  73. package/src/rules/common/__tests__/operation-security-defined.test.ts +1 -2
  74. package/src/rules/common/__tests__/operation-singular-tag.test.ts +1 -2
  75. package/src/rules/common/__tests__/path-http-verbs-order.test.ts +1 -2
  76. package/src/rules/common/__tests__/path-not-include-query.test.ts +1 -2
  77. package/src/rules/common/__tests__/path-params-defined.test.ts +1 -2
  78. package/src/rules/common/__tests__/paths-kebab-case.test.ts +1 -2
  79. package/src/rules/common/__tests__/tag-description.test.ts +1 -2
  80. package/src/rules/common/__tests__/tags-alphabetical.test.ts +1 -2
  81. package/src/rules/common/operation-security-defined.ts +4 -5
  82. package/src/rules/common/spec.ts +18 -0
  83. package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +1 -2
  84. package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +1 -2
  85. package/src/rules/oas2/index.ts +1 -11
  86. package/src/rules/oas2/remove-unused-components.ts +76 -0
  87. package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +1 -2
  88. package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +1 -2
  89. package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +1 -2
  90. package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +1 -2
  91. package/src/rules/oas3/__tests__/no-server-example.com.test.ts +1 -2
  92. package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +1 -2
  93. package/src/rules/oas3/__tests__/no-unused-components.test.ts +1 -2
  94. package/src/rules/oas3/index.ts +0 -12
  95. package/src/rules/oas3/no-invalid-media-type-examples.ts +17 -21
  96. package/src/rules/oas3/remove-unused-components.ts +84 -0
  97. package/src/types/index.ts +4 -0
  98. package/src/types/oas2.ts +42 -43
  99. package/src/types/oas3.ts +68 -141
  100. package/src/types/oas3_1.ts +51 -50
  101. package/src/typings/swagger.ts +7 -0
  102. package/src/utils.ts +9 -1
  103. package/src/walk.ts +6 -13
  104. package/tsconfig.tsbuildinfo +1 -1
  105. package/lib/rules/builtin.d.ts +0 -20
  106. package/lib/rules/builtin.js +0 -17
  107. package/src/rules/__tests__/config.ts +0 -10
  108. package/src/rules/builtin.ts +0 -18
@@ -0,0 +1,316 @@
1
+ import { outdent } from 'outdent';
2
+ import { bundleDocument } from '../../bundle';
3
+ import { BaseResolver } from '../../resolve';
4
+ import { parseYamlToDocument, yamlSerializer, makeConfig } from '../../../__tests__/utils';
5
+
6
+ describe('oas3 remove-x-internal', () => {
7
+ expect.addSnapshotSerializer(yamlSerializer);
8
+ const testDocument = parseYamlToDocument(
9
+ outdent`
10
+ openapi: 3.0.0
11
+ paths:
12
+ /pet:
13
+ removeit: true
14
+ get:
15
+ parameters:
16
+ - $ref: '#/components/parameters/x'
17
+ components:
18
+ parameters:
19
+ x:
20
+ name: x
21
+ `,
22
+ );
23
+
24
+ it('should use `internalFlagProperty` option to remove internal paths', async () => {
25
+ const { bundle: res } = await bundleDocument({
26
+ document: testDocument,
27
+ externalRefResolver: new BaseResolver(),
28
+ config: makeConfig({}, { 'remove-x-internal': { internalFlagProperty: 'removeit' } }),
29
+ });
30
+ expect(res.parsed).toMatchInlineSnapshot(`
31
+ openapi: 3.0.0
32
+ components:
33
+ parameters:
34
+ x:
35
+ name: x
36
+
37
+ `);
38
+ });
39
+
40
+ it('should clean types: Server, Operation, Parameter, PathItem, Example', async () => {
41
+ const testDoc = parseYamlToDocument(
42
+ outdent`
43
+ openapi: 3.1.0
44
+ servers:
45
+ - url: //petstore.swagger.io/v2
46
+ description: Default server
47
+ x-internal: true
48
+ paths:
49
+ /pet:
50
+ get:
51
+ x-internal: true
52
+ operationId: getPet
53
+ parameters:
54
+ - $ref: '#/components/parameters/x'
55
+ put:
56
+ parameters:
57
+ - name: Accept-Language
58
+ x-internal: true
59
+ in: header
60
+ example: en-US
61
+ required: false
62
+ - name: cookieParam
63
+ x-internal: true
64
+ in: cookie
65
+ description: Some cookie
66
+ required: true
67
+ /admin:
68
+ x-internal: true
69
+ post:
70
+ parameters:
71
+ - $ref: '#/components/parameters/y'
72
+ /store/order:
73
+ post:
74
+ operationId: placeOrder
75
+ responses:
76
+ '200':
77
+ description: successful operation
78
+ content:
79
+ application/json:
80
+ examples:
81
+ response:
82
+ x-internal: true
83
+ value: OK
84
+ components:
85
+ parameters:
86
+ x:
87
+ name: x
88
+ y:
89
+ name: y
90
+ `,
91
+ );
92
+ const { bundle: res } = await bundleDocument({
93
+ document: testDoc,
94
+ externalRefResolver: new BaseResolver(),
95
+ config: makeConfig({}, { 'remove-x-internal': 'on' }),
96
+ });
97
+ expect(res.parsed).toMatchInlineSnapshot(`
98
+ openapi: 3.1.0
99
+ paths:
100
+ /pet:
101
+ put: {}
102
+ /store/order:
103
+ post:
104
+ operationId: placeOrder
105
+ responses:
106
+ '200':
107
+ description: successful operation
108
+ content:
109
+ application/json: {}
110
+ components:
111
+ parameters:
112
+ x:
113
+ name: x
114
+ 'y':
115
+ name: 'y'
116
+
117
+ `);
118
+ });
119
+
120
+ it('should clean types: Schema, Response, RequestBody, MediaType, Callback', async () => {
121
+ const testDoc = parseYamlToDocument(
122
+ outdent`
123
+ openapi: 3.1.0
124
+ paths:
125
+ /pet:
126
+ post:
127
+ summary: test
128
+ requestBody:
129
+ x-internal: true
130
+ content:
131
+ application/x-www-form-urlencoded:
132
+ schema:
133
+ type: object
134
+ /store/order:
135
+ post:
136
+ operationId: storeOrder
137
+ parameters:
138
+ - name: api_key
139
+ schema:
140
+ x-internal: true
141
+ type: string
142
+ responses:
143
+ '200':
144
+ x-internal: true
145
+ content:
146
+ application/json:
147
+ examples:
148
+ response:
149
+ value: OK
150
+ requestBody:
151
+ content:
152
+ application/x-www-form-urlencoded:
153
+ x-internal: true
154
+ schema:
155
+ type: object
156
+ callbacks:
157
+ orderInProgress:
158
+ x-internal: true
159
+ '{$request.body#/callbackUrl}?event={$request.body#/eventName}':
160
+ servers:
161
+ - url: //callback-url.path-level/v1
162
+ description: Path level server
163
+ `,
164
+ );
165
+ const { bundle: res } = await bundleDocument({
166
+ document: testDoc,
167
+ externalRefResolver: new BaseResolver(),
168
+ config: makeConfig({}, { 'remove-x-internal': 'on' }),
169
+ });
170
+
171
+ expect(res.parsed).toMatchInlineSnapshot(`
172
+ openapi: 3.1.0
173
+ paths:
174
+ /pet:
175
+ post:
176
+ summary: test
177
+ /store/order:
178
+ post:
179
+ operationId: storeOrder
180
+ parameters:
181
+ - name: api_key
182
+ requestBody: {}
183
+ components: {}
184
+
185
+ `);
186
+ });
187
+
188
+ it('should remove refs', async () => {
189
+ const testDoc = parseYamlToDocument(
190
+ outdent`
191
+ openapi: 3.0.1
192
+ info:
193
+ version: 1.0.0
194
+ title: Test API
195
+ paths:
196
+ /test1:
197
+ get:
198
+ parameters:
199
+ - $ref: '#/components/parameters/Internal'
200
+ - in: query
201
+ name: inline
202
+ schema:
203
+ type: string
204
+ - in: query
205
+ name: inline-internal
206
+ schema:
207
+ type: string
208
+ x-internal: true
209
+ /test2:
210
+ get:
211
+ parameters:
212
+ - $ref: '#/components/parameters/Public'
213
+ - $ref: '#/components/parameters/Internal'
214
+ requestBody:
215
+ $ref: '#/components/requestBodies/Public'
216
+ components:
217
+ requestBodies:
218
+ Public:
219
+ content:
220
+ application/json:
221
+ schema:
222
+ type: string
223
+ required: true
224
+ x-internal: true
225
+ parameters:
226
+ Public:
227
+ in: path
228
+ name: product_id
229
+ schema:
230
+ type: string
231
+ Internal:
232
+ in: header
233
+ name: X-Vendor
234
+ schema:
235
+ type: string
236
+ x-internal: true
237
+ `,
238
+ );
239
+ const { bundle: res } = await bundleDocument({
240
+ document: testDoc,
241
+ externalRefResolver: new BaseResolver(),
242
+ config: makeConfig({}, { 'remove-x-internal': 'on' }),
243
+ });
244
+ expect(res.parsed).toMatchInlineSnapshot(`
245
+ openapi: 3.0.1
246
+ info:
247
+ version: 1.0.0
248
+ title: Test API
249
+ paths:
250
+ /test1:
251
+ get:
252
+ parameters:
253
+ - in: query
254
+ name: inline
255
+ schema:
256
+ type: string
257
+ /test2:
258
+ get:
259
+ parameters:
260
+ - $ref: '#/components/parameters/Public'
261
+ components:
262
+ parameters:
263
+ Public:
264
+ in: path
265
+ name: product_id
266
+ schema:
267
+ type: string
268
+
269
+ `);
270
+ });
271
+ });
272
+
273
+ describe('oas2 remove-x-internal', () => {
274
+ it('should clean types - base test', async () => {
275
+ const testDoc = parseYamlToDocument(
276
+ outdent`
277
+ swagger: '2.0'
278
+ host: api.instagram.com
279
+ paths:
280
+ '/geographies/{geo-id}/media/recent':
281
+ get:
282
+ parameters:
283
+ - description: The geography ID.
284
+ x-internal: true
285
+ in: path
286
+ name: geo-id
287
+ required: true
288
+ type: string
289
+ - description: Max number of media to return.
290
+ x-internal: true
291
+ format: int32
292
+ in: query
293
+ name: count
294
+ required: false
295
+ type: integer
296
+ responses:
297
+ '200':
298
+ x-internal: true
299
+ description: List of recent media entries.
300
+ `,
301
+ );
302
+ const { bundle: res } = await bundleDocument({
303
+ document: testDoc,
304
+ externalRefResolver: new BaseResolver(),
305
+ config: makeConfig({}, { 'remove-x-internal': 'on' }),
306
+ });
307
+ expect(res.parsed).toMatchInlineSnapshot(`
308
+ swagger: '2.0'
309
+ host: api.instagram.com
310
+ paths:
311
+ /geographies/{geo-id}/media/recent:
312
+ get: {}
313
+
314
+ `);
315
+ });
316
+ });
@@ -0,0 +1,59 @@
1
+ import { Oas3Decorator, Oas2Decorator } from '../../visitors';
2
+ import { isEmptyArray, isEmptyObject, isPlainObject } from '../../utils';
3
+ import { UserContext } from '../../walk';
4
+ import { isRef } from '../../ref-utils';
5
+
6
+ const DEFAULT_INTERNAL_PROPERTY_NAME = 'x-internal';
7
+
8
+ export const RemoveXInternal: Oas3Decorator | Oas2Decorator = ({ internalFlagProperty }) => {
9
+ const hiddenTag = internalFlagProperty || DEFAULT_INTERNAL_PROPERTY_NAME;
10
+
11
+ function removeInternal(node: any, ctx: UserContext) {
12
+ const { parent, key } = ctx;
13
+ let didDelete = false;
14
+ if (Array.isArray(node)) {
15
+ for (let i = 0; i < node.length; i++) {
16
+ if (isRef(node[i])) {
17
+ const resolved = ctx.resolve(node[i]);
18
+ if (resolved.node?.[hiddenTag]) {
19
+ node.splice(i, 1);
20
+ didDelete = true;
21
+ i--;
22
+ }
23
+ }
24
+ if (node[i]?.[hiddenTag]) {
25
+ node.splice(i, 1);
26
+ didDelete = true;
27
+ i--;
28
+ }
29
+ }
30
+ } else if (isPlainObject(node)) {
31
+ for (const key of Object.keys(node)) {
32
+ node = node as any;
33
+ if (isRef(node[key])) {
34
+ const resolved = ctx.resolve(node[key]);
35
+ if (resolved.node?.[hiddenTag]) {
36
+ delete node[key];
37
+ didDelete = true;
38
+ }
39
+ }
40
+ if (node[key]?.[hiddenTag]) {
41
+ delete node[key];
42
+ didDelete = true;
43
+ }
44
+ }
45
+ }
46
+
47
+ if (didDelete && (isEmptyObject(node) || isEmptyArray(node))) {
48
+ delete parent[key];
49
+ }
50
+ }
51
+
52
+ return {
53
+ any: {
54
+ enter: (node, ctx) => {
55
+ removeInternal(node, ctx);
56
+ }
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,14 @@
1
+ import { Oas2Decorator } from '../../visitors';
2
+ import { RegistryDependencies } from '../common/registry-dependencies';
3
+ import { OperationDescriptionOverride } from '../common/operation-description-override';
4
+ import { TagDescriptionOverride } from '../common/tag-description-override';
5
+ import { InfoDescriptionOverride } from '../common/info-description-override';
6
+ import { RemoveXInternal } from '../common/remove-x-internal';
7
+
8
+ export const decorators = {
9
+ 'registry-dependencies': RegistryDependencies as Oas2Decorator,
10
+ 'operation-description-override': OperationDescriptionOverride as Oas2Decorator,
11
+ 'tag-description-override': TagDescriptionOverride as Oas2Decorator,
12
+ 'info-description-override': InfoDescriptionOverride as Oas2Decorator,
13
+ 'remove-x-internal': RemoveXInternal as Oas2Decorator
14
+ };
@@ -0,0 +1,14 @@
1
+ import { Oas3Decorator } from '../../visitors';
2
+ import { RegistryDependencies } from '../common/registry-dependencies';
3
+ import { OperationDescriptionOverride } from '../common/operation-description-override';
4
+ import { TagDescriptionOverride } from '../common/tag-description-override';
5
+ import { InfoDescriptionOverride } from '../common/info-description-override';
6
+ import { RemoveXInternal } from '../common/remove-x-internal';
7
+
8
+ export const decorators = {
9
+ 'registry-dependencies': RegistryDependencies as Oas3Decorator,
10
+ 'operation-description-override': OperationDescriptionOverride as Oas3Decorator,
11
+ 'tag-description-override': TagDescriptionOverride as Oas3Decorator,
12
+ 'info-description-override': InfoDescriptionOverride as Oas3Decorator,
13
+ 'remove-x-internal': RemoveXInternal as Oas3Decorator
14
+ };
@@ -15,5 +15,4 @@ const DEFAULT_SCHEMA_WITHOUT_TIMESTAMP = JSON_SCHEMA.extend({
15
15
  export const parseYaml = (str: string, opts?: LoadOptions): unknown =>
16
16
  load(str, {schema: DEFAULT_SCHEMA_WITHOUT_TIMESTAMP, ...opts});
17
17
 
18
- export const stringifyYaml = (obj: any, opts?: DumpOptions): string =>
19
- dump(obj, {schema: DEFAULT_SCHEMA_WITHOUT_TIMESTAMP, ...opts});
18
+ export const stringifyYaml = (obj: any, opts?: DumpOptions): string => dump(obj, opts);
@@ -3,6 +3,7 @@ import { RegistryApiTypes } from './registry-api-types';
3
3
  import { AccessTokens, Region, DEFAULT_REGION, DOMAINS } from '../config/config';
4
4
  import { isNotEmptyObject } from '../utils';
5
5
  const version = require('../../package.json').version;
6
+ const HttpsProxyAgent = require('https-proxy-agent');
6
7
 
7
8
  export class RegistryApi {
8
9
  constructor(private accessTokens: AccessTokens, private region: Region) {}
@@ -23,7 +24,12 @@ export class RegistryApi {
23
24
  private async request(path = '', options: RequestInit = {}, region?: Region) {
24
25
  const headers = Object.assign({}, options.headers || {}, { 'x-redocly-cli-version': version });
25
26
  if (!headers.hasOwnProperty('authorization')) { throw new Error('Unauthorized'); }
26
- const response = await fetch(`${this.getBaseUrl(region)}${path}`, Object.assign({}, options, { headers }));
27
+ const proxy = process.env.REDOCLY_PROXY;
28
+ const agent = proxy ? new HttpsProxyAgent(proxy) : undefined;
29
+ const response = await fetch(
30
+ `${this.getBaseUrl(region)}${path}`,
31
+ Object.assign({}, options, { headers, agent }),
32
+ );
27
33
  if (response.status === 401) { throw new Error('Unauthorized'); }
28
34
  if (response.status === 404) {
29
35
  const body: RegistryApiTypes.NotFoundProblemResponse = await response.json();
package/src/resolve.ts CHANGED
@@ -74,6 +74,10 @@ export type Document = {
74
74
  parsed: any;
75
75
  };
76
76
 
77
+ export function makeRefId(absoluteRef: string, pointer: string) {
78
+ return absoluteRef + '::' + pointer;
79
+ }
80
+
77
81
  export function makeDocumentFromString(sourceString: string, absoluteRef: string) {
78
82
  const source = new Source(absoluteRef, sourceString);
79
83
  try {
@@ -323,10 +327,8 @@ export async function resolveDocument(opts: {
323
327
  document: undefined,
324
328
  error: error,
325
329
  };
326
-
327
- const refId = document.source.absoluteRef + '::' + ref.$ref;
330
+ const refId = makeRefId(document.source.absoluteRef, ref.$ref);
328
331
  resolvedRefMap.set(refId, resolvedRef);
329
-
330
332
  return resolvedRef;
331
333
  }
332
334
 
@@ -367,13 +369,11 @@ export async function resolveDocument(opts: {
367
369
 
368
370
  resolvedRef.node = target;
369
371
  resolvedRef.document = targetDoc;
370
- const refId = document.source.absoluteRef + '::' + ref.$ref;
371
-
372
+ const refId = makeRefId(document.source.absoluteRef, ref.$ref);
372
373
  if (resolvedRef.document && isRef(target)) {
373
374
  resolvedRef = await followRef(resolvedRef.document, target, pushRef(refStack, target));
374
375
  }
375
376
  resolvedRefMap.set(refId, resolvedRef);
376
-
377
377
  return { ...resolvedRef };
378
378
  }
379
379
  }
@@ -1,11 +1,8 @@
1
1
  import path = require('path');
2
2
  import { outdent } from 'outdent';
3
-
4
3
  import { lintDocument } from '../../lint';
5
4
  import { BaseResolver } from '../../resolve';
6
-
7
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../__tests__/utils';
8
- import { makeConfig } from './config';
5
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../__tests__/utils';
9
6
 
10
7
  describe('oas3 boolean-parameter-prefixes', () => {
11
8
  it('should report on unresolved $ref', async () => {
@@ -1,10 +1,8 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
4
4
  import { BaseResolver } from '../../../resolve';
5
5
 
6
- import { makeConfig } from '../../__tests__/config';
7
-
8
6
  describe('Oas3 info-description', () => {
9
7
  it('should report on info with no description', async () => {
10
8
  const document = parseYamlToDocument(
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Oas3 info-license', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Oas3 license-url', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('no-ambiguous-paths', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Oas3 typed enum', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('no-identical-paths', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('no-path-trailing-slash', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Oas3 operation-2xx-response', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Oas3 operation-4xx-response', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Oas3 operation-operationId-unique', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Oas3 operation-operationId-url-safe', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Oas3 operation-parameters-unique', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Oas3 operation-security-defined', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Oas3 operation-singular-tag', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Common path-http-verbs-order', () => {
@@ -1,7 +1,6 @@
1
1
  import { outdent } from 'outdent';
2
2
  import { lintDocument } from '../../../lint';
3
- import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
4
- import { makeConfig } from '../../__tests__/config';
3
+ import { parseYamlToDocument, replaceSourceWithRef, makeConfig } from '../../../../__tests__/utils';
5
4
  import { BaseResolver } from '../../../resolve';
6
5
 
7
6
  describe('Oas3 path-not-include-query', () => {