Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ref-resolver): bump @stoplight/json-ref-resolver from ~3.1.4 to ~3.1.5 #2365

Merged
merged 2 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions packages/core/src/__tests__/linter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1637,4 +1637,49 @@ responses:: !!foo
}),
]);
});

test.concurrent('should handle direct circular file $refs', async () => {
const spectral = new Spectral();
spectral.setRuleset({
rules: {
'valid-type': {
given: '$..type',
then: {
function() {
return [
{
message: 'Restricted type',
},
];
},
},
},
},
});

const documentUri = path.join(__dirname, './__fixtures__/test.json');
const document = new Document(
JSON.stringify({
oneOf: [
{
type: 'number',
},
{
$ref: './test.json',
},
],
}),
Parsers.Json,
documentUri,
);
const results = spectral.run(document);

await expect(results).resolves.toEqual([
expect.objectContaining({
code: 'valid-type',
path: ['oneOf', '0', 'type'],
severity: DiagnosticSeverity.Warning,
}),
]);
});
});
2 changes: 1 addition & 1 deletion packages/ref-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"dependencies": {
"@stoplight/json-ref-readers": "1.2.2",
"@stoplight/json-ref-resolver": "~3.1.4",
"@stoplight/json-ref-resolver": "~3.1.5",
"@stoplight/spectral-runtime": "^1.1.2",
"dependency-graph": "0.11.0",
"tslib": "^2.3.1"
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2427,9 +2427,9 @@ __metadata:
languageName: node
linkType: hard

"@stoplight/json-ref-resolver@npm:~3.1.4":
version: 3.1.4
resolution: "@stoplight/json-ref-resolver@npm:3.1.4"
"@stoplight/json-ref-resolver@npm:~3.1.5":
version: 3.1.5
resolution: "@stoplight/json-ref-resolver@npm:3.1.5"
dependencies:
"@stoplight/json": ^3.17.0
"@stoplight/path": ^1.3.2
Expand All @@ -2441,7 +2441,7 @@ __metadata:
lodash: ^4.17.21
tslib: ^2.3.1
urijs: ^1.19.11
checksum: 9da64dc9209420d335d00487c1a50094debb2511ca8ab2c755baea275a7fc4d70695cedbbf1b2d72f05034be395fde47e1b42957b1a7a21325850d5ccc5e60e4
checksum: b2df82e899717ffa7bab9ec4c380f206511b3971d242724afd34e8b964e5aa7be2a52e32ba48d435548a9ac13a63a2271ca69182abec8506fc3bb3cc129f6380
languageName: node
linkType: hard

Expand Down Expand Up @@ -2594,7 +2594,7 @@ __metadata:
resolution: "@stoplight/spectral-ref-resolver@workspace:packages/ref-resolver"
dependencies:
"@stoplight/json-ref-readers": 1.2.2
"@stoplight/json-ref-resolver": ~3.1.4
"@stoplight/json-ref-resolver": ~3.1.5
"@stoplight/spectral-runtime": ^1.1.2
dependency-graph: 0.11.0
tslib: ^2.3.1
Expand Down