Skip to content

Commit

Permalink
fix: empty $refs should not be ignored (#1540)
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip authored Mar 5, 2021
1 parent d9a6a03 commit 67d81da
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@stoplight/better-ajv-errors": "0.0.4",
"@stoplight/json": "3.10.2",
"@stoplight/json-ref-readers": "1.2.2",
"@stoplight/json-ref-resolver": "3.1.1",
"@stoplight/json-ref-resolver": "3.1.2",
"@stoplight/lifecycle": "2.3.2",
"@stoplight/path": "1.3.2",
"@stoplight/types": "11.9.0",
Expand Down
17 changes: 17 additions & 0 deletions src/__tests__/spectral.jest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,23 @@ describe('Spectral', () => {
severity: DiagnosticSeverity.Warning,
source: documentUri,
},
{
code: 'invalid-ref',
message: 'EISDIR: illegal operation on a directory, read',
path: ['empty', '$ref'],
range: {
end: {
character: 14,
line: 5,
},
start: {
character: 12,
line: 5,
},
},
severity: DiagnosticSeverity.Error,
source: documentUri,
},
{
code: 'requires-type',
message: '`allOf.type` property is not truthy',
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1186,10 +1186,10 @@
node-fetch "^2.6.0"
tslib "^1.14.1"

"@stoplight/json-ref-resolver@3.1.1":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@stoplight/json-ref-resolver/-/json-ref-resolver-3.1.1.tgz#c450b71ff8c8ed25eeb547244c0c4e7646fc9991"
integrity sha512-FUOu3nPwbX2COczcCwvUz1EpqRNYlw7Ng8keOWGiwKmlXVz4OKdRw4hi2HUg9QNSX1CyFVJ3A3pPtpkizfKqlg==
"@stoplight/json-ref-resolver@3.1.2":
version "3.1.2"
resolved "https://registry.yarnpkg.com/@stoplight/json-ref-resolver/-/json-ref-resolver-3.1.2.tgz#ae218cf6062d6be490c135603478415e700b52ba"
integrity sha512-SwSvhQ1jNDDLrmKSc17cEx2zZxjzF1tB4nmzaD5fn/r0oI77CNL0Rts4tAVodXVFKrWnaNWZuZmlla6x8y7eFA==
dependencies:
"@stoplight/json" "^3.10.2"
"@stoplight/path" "^1.3.2"
Expand Down

0 comments on commit 67d81da

Please sign in to comment.