@redocly/openapi-core
Advanced tools
Comparing version 1.0.0-beta.40 to 1.0.0-beta.41
@@ -13,30 +13,27 @@ import outdent from 'outdent'; | ||
const testDocument = parseYamlToDocument( | ||
outdent` | ||
openapi: 3.0.0 | ||
paths: | ||
/pet: | ||
get: | ||
operationId: get | ||
parameters: | ||
- $ref: '#/components/parameters/shared_a' | ||
- name: get_b | ||
post: | ||
operationId: post | ||
parameters: | ||
- $ref: '#/components/parameters/shared_a' | ||
components: | ||
parameters: | ||
shared_a: | ||
name: shared-a | ||
`, | ||
'', | ||
); | ||
it('change nothing with only internal refs', async () => { | ||
const document = parseYamlToDocument( | ||
outdent` | ||
openapi: 3.0.0 | ||
info: | ||
contact: {} | ||
license: {} | ||
paths: | ||
/pet: | ||
get: | ||
operationId: get | ||
parameters: | ||
- $ref: '#/components/parameters/shared_a' | ||
- name: get_b | ||
post: | ||
operationId: post | ||
parameters: | ||
- $ref: '#/components/parameters/shared_a' | ||
components: | ||
parameters: | ||
shared_a: | ||
name: shared-a | ||
`, | ||
'', | ||
); | ||
const { bundle, problems } = await bundleDocument({ | ||
document, | ||
document: testDocument, | ||
externalRefResolver: new BaseResolver(), | ||
@@ -46,3 +43,3 @@ config: new LintConfig({}), | ||
const origCopy = JSON.parse(JSON.stringify(document.parsed)); | ||
const origCopy = JSON.parse(JSON.stringify(testDocument.parsed)); | ||
@@ -73,2 +70,14 @@ expect(problems).toHaveLength(0); | ||
}); | ||
it('should dereferenced correctly when used with dereference', async () => { | ||
const { bundle: res, problems } = await bundleDocument({ | ||
externalRefResolver: new BaseResolver(), | ||
config: new LintConfig({}), | ||
document: testDocument, | ||
dereference: true, | ||
}); | ||
expect(problems).toHaveLength(0); | ||
expect(res.parsed).toMatchSnapshot(); | ||
}); | ||
}); |
@@ -131,3 +131,4 @@ "use strict"; | ||
resolved.location.source === ctx.location.source && | ||
ctx.type.name !== 'scalar') { | ||
ctx.type.name !== 'scalar' && | ||
!dereference) { | ||
return; | ||
@@ -134,0 +135,0 @@ } |
{ | ||
"name": "@redocly/openapi-core", | ||
"version": "1.0.0-beta.40", | ||
"version": "1.0.0-beta.41", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -166,3 +166,4 @@ import isEqual = require('lodash.isequal'); | ||
resolved.location.source === ctx.location.source && | ||
ctx.type.name !== 'scalar' | ||
ctx.type.name !== 'scalar' && | ||
!dereference | ||
) { | ||
@@ -169,0 +170,0 @@ return; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1881934
19999