-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #473 from stoplightio/feat/no-ref-siblings
feat: $ref cannot have siblings
- v6.14.3
- v6.14.2
- v6.14.1
- v6.14.0
- v6.13.1
- v6.12.0
- v6.11.1
- v6.11.0
- v6.10.1
- v6.10.0
- v6.9.0
- v6.8.0
- v6.7.0
- v6.6.0
- v6.5.1
- v6.5.0
- v6.4.2
- v6.4.1
- v6.4.0
- v6.3.0
- v6.2.1
- v6.2.0
- v6.1.1
- v6.1.0
- v6.0.1
- v6.0.0
- v6.0.0-alpha3
- v6.0.0-alpha2
- v6.0.0-alpha1
- v5.9.2
- v5.9.1
- v5.9.0
- v5.8.1
- v5.8.0
- v5.7.2
- v5.7.1
- v5.7.0
- v5.6.0
- v5.5.0
- v5.5.0-beta10
- v5.5.0-beta9
- v5.5.0-beta8
- v5.5.0-beta7
- v5.5.0-beta6
- v5.5.0-beta5
- v5.5.0-beta4
- v5.5.0-beta3
- v5.5.0-beta2
- v5.5.0-beta1
- v5.4.0
- v5.4.0-beta1
- v5.3.0
- v5.2.0
- v5.1.0
- v5.0.0
- v5.0.0-beta4
- v5.0.0-beta3
- v5.0.0-beta2
- v5.0.0-beta1
- v4.2.0
- v4.2.0-beta5
- v4.2.0-beta4
- v4.2.0-beta3
- v4.2.0-beta2
- v4.2.0-beta1
- v4.2.0-beta
- v4.1.1
- v4.1.1-beta4
- v4.1.1-beta3
- v4.1.1-beta2
- v4.1.0
- v4.1.0-beta3
- v4.1.0-beta2
- v4.1.0-beta1
- @stoplight/spectral-runtime-v1.1.2
- @stoplight/spectral-runtime-v1.1.1
- @stoplight/spectral-runtime-v1.1.0
- @stoplight/spectral-runtime-v1.0.0
- @stoplight/spectral-runtime-1.1.3
- @stoplight/spectral-rulesets-v1.16.0
- @stoplight/spectral-rulesets-v1.15.1
- @stoplight/spectral-rulesets-v1.15.0
- @stoplight/spectral-rulesets-v1.14.1
- @stoplight/spectral-rulesets-v1.14.0
- @stoplight/spectral-rulesets-v1.13.0
- @stoplight/spectral-rulesets-v1.12.0
- @stoplight/spectral-rulesets-v1.11.3
- @stoplight/spectral-rulesets-v1.11.2
- @stoplight/spectral-rulesets-v1.11.1
- @stoplight/spectral-rulesets-v1.11.0
- @stoplight/spectral-rulesets-v1.10.0
- @stoplight/spectral-rulesets-v1.9.0
- @stoplight/spectral-rulesets-v1.8.0
- @stoplight/spectral-rulesets-v1.7.0
- @stoplight/spectral-rulesets-v1.6.0
- @stoplight/spectral-rulesets-v1.5.2
- @stoplight/spectral-rulesets-v1.5.1
- @stoplight/spectral-rulesets-v1.5.0
- @stoplight/spectral-rulesets-v1.4.3
- @stoplight/spectral-rulesets-v1.4.2
- @stoplight/spectral-rulesets-v1.4.1
- @stoplight/spectral-rulesets-v1.4.0
- @stoplight/spectral-rulesets-v1.3.2
- @stoplight/spectral-rulesets-v1.3.1
- @stoplight/spectral-rulesets-v1.3.0
- @stoplight/spectral-rulesets-v1.2.7
- @stoplight/spectral-rulesets-v1.2.6
- @stoplight/spectral-rulesets-v1.2.5
- @stoplight/spectral-rulesets-v1.2.4
- @stoplight/spectral-rulesets-v1.2.3
- @stoplight/spectral-rulesets-v1.2.2
- @stoplight/spectral-rulesets-v1.2.1
- @stoplight/spectral-rulesets-v1.2.0
- @stoplight/spectral-rulesets-v1.1.0
- @stoplight/spectral-rulesets-v1.0.0
- @stoplight/spectral-rulesets-1.21.3
- @stoplight/spectral-rulesets-1.21.2
- @stoplight/spectral-rulesets-1.21.1
- @stoplight/spectral-rulesets-1.21.0
- @stoplight/spectral-rulesets-1.20.2
- @stoplight/spectral-rulesets-1.20.1
- @stoplight/spectral-rulesets-1.20.0
- @stoplight/spectral-rulesets-1.19.1
- @stoplight/spectral-rulesets-1.19.0
- @stoplight/spectral-rulesets-1.18.1
- @stoplight/spectral-rulesets-1.18.0
- @stoplight/spectral-rulesets-1.17.1
- @stoplight/spectral-rulesets-1.17.0
- @stoplight/spectral-ruleset-migrator-v1.9.3
- @stoplight/spectral-ruleset-migrator-v1.9.2
- @stoplight/spectral-ruleset-migrator-v1.9.1
- @stoplight/spectral-ruleset-migrator-v1.9.0
- @stoplight/spectral-ruleset-migrator-v1.8.0
- @stoplight/spectral-ruleset-migrator-v1.7.4
- @stoplight/spectral-ruleset-migrator-v1.7.3
- @stoplight/spectral-ruleset-migrator-v1.7.2
- @stoplight/spectral-ruleset-migrator-v1.7.1
- @stoplight/spectral-ruleset-migrator-v1.7.0
- @stoplight/spectral-ruleset-migrator-v1.6.1
- @stoplight/spectral-ruleset-migrator-v1.6.0
- @stoplight/spectral-ruleset-migrator-v1.5.2
- @stoplight/spectral-ruleset-migrator-v1.5.1
- @stoplight/spectral-ruleset-migrator-v1.5.0
- @stoplight/spectral-ruleset-migrator-v1.4.4
- @stoplight/spectral-ruleset-migrator-v1.4.3
- @stoplight/spectral-ruleset-migrator-v1.4.2
- @stoplight/spectral-ruleset-migrator-v1.4.1
- @stoplight/spectral-ruleset-migrator-v1.4.0
- @stoplight/spectral-ruleset-migrator-v1.3.0
- @stoplight/spectral-ruleset-migrator-v1.2.0
- @stoplight/spectral-ruleset-migrator-v1.1.2
- @stoplight/spectral-ruleset-migrator-v1.1.1
- @stoplight/spectral-ruleset-migrator-v1.1.0
- @stoplight/spectral-ruleset-migrator-v1.0.0
- @stoplight/spectral-ruleset-migrator-1.11.1
- @stoplight/spectral-ruleset-migrator-1.11.0
- @stoplight/spectral-ruleset-migrator-1.10.0
- @stoplight/spectral-ruleset-migrator-1.9.5
- @stoplight/spectral-ruleset-migrator-1.9.4
- @stoplight/spectral-ruleset-bundler-v1.5.2
- @stoplight/spectral-ruleset-bundler-v1.5.1
- @stoplight/spectral-ruleset-bundler-v1.5.0
- @stoplight/spectral-ruleset-bundler-v1.4.0
- @stoplight/spectral-ruleset-bundler-v1.3.3
- @stoplight/spectral-ruleset-bundler-v1.3.2
- @stoplight/spectral-ruleset-bundler-v1.3.1
- @stoplight/spectral-ruleset-bundler-v1.3.0
- @stoplight/spectral-ruleset-bundler-v1.2.1
- @stoplight/spectral-ruleset-bundler-v1.2.0
- @stoplight/spectral-ruleset-bundler-v1.1.1
- @stoplight/spectral-ruleset-bundler-v1.1.0
- @stoplight/spectral-ruleset-bundler-v1.0.1
- @stoplight/spectral-ruleset-bundler-v1.0.0
- @stoplight/spectral-ruleset-bundler-1.6.1
- @stoplight/spectral-ruleset-bundler-1.6.0
- @stoplight/spectral-ref-resolver-v1.0.3
- @stoplight/spectral-ref-resolver-v1.0.2
- @stoplight/spectral-ref-resolver-v1.0.1
- @stoplight/spectral-ref-resolver-v1.0.0
- @stoplight/spectral-ref-resolver-1.0.5
- @stoplight/spectral-ref-resolver-1.0.4
- @stoplight/spectral-parsers-v1.0.2
- @stoplight/spectral-parsers-v1.0.1
- @stoplight/spectral-parsers-v1.0.0
- @stoplight/spectral-parsers-1.0.5
- @stoplight/spectral-parsers-1.0.4
- @stoplight/spectral-parsers-1.0.3
- @stoplight/spectral-functions-v1.7.2
- @stoplight/spectral-functions-v1.7.1
- @stoplight/spectral-functions-v1.7.0
- @stoplight/spectral-functions-v1.6.2
- @stoplight/spectral-functions-v1.6.1
- @stoplight/spectral-functions-v1.6.0
- @stoplight/spectral-functions-v1.5.2
- @stoplight/spectral-functions-v1.5.1
- @stoplight/spectral-functions-v1.5.0
- @stoplight/spectral-functions-v1.4.0
- @stoplight/spectral-functions-v1.3.0
- @stoplight/spectral-functions-v1.2.1
- @stoplight/spectral-functions-v1.2.0
- @stoplight/spectral-functions-v1.1.2
- @stoplight/spectral-functions-v1.1.1
- @stoplight/spectral-functions-v1.1.0
- @stoplight/spectral-functions-v1.0.0
- @stoplight/spectral-functions-1.9.3
- @stoplight/spectral-functions-1.9.2
- @stoplight/spectral-functions-1.9.1
- @stoplight/spectral-functions-1.9.0
- @stoplight/spectral-functions-1.8.0
- @stoplight/spectral-formatters-v1.0.0
- @stoplight/spectral-formatters-1.4.3
- @stoplight/spectral-formatters-1.4.2
- @stoplight/spectral-formatters-1.4.1
- @stoplight/spectral-formatters-1.4.0
- @stoplight/spectral-formatters-1.3.0
- @stoplight/spectral-formatters-1.2.0
- @stoplight/spectral-formatters-1.1.0
- @stoplight/spectral-formats-v1.5.0
- @stoplight/spectral-formats-v1.4.0
- @stoplight/spectral-formats-v1.3.0
- @stoplight/spectral-formats-v1.2.0
- @stoplight/spectral-formats-v1.1.0
- @stoplight/spectral-formats-v1.0.2
- @stoplight/spectral-formats-v1.0.1
- @stoplight/spectral-formats-v1.0.0
- @stoplight/spectral-formats-1.8.2
- @stoplight/spectral-formats-1.8.1
- @stoplight/spectral-formats-1.8.0
- @stoplight/spectral-formats-1.7.0
- @stoplight/spectral-formats-1.6.0
- @stoplight/spectral-core-v1.18.0
- @stoplight/spectral-core-v1.17.0
- @stoplight/spectral-core-v1.16.1
- @stoplight/spectral-core-v1.16.0
- @stoplight/spectral-core-v1.15.2
- @stoplight/spectral-core-v1.15.1
- @stoplight/spectral-core-v1.15.0
- @stoplight/spectral-core-v1.14.2
- @stoplight/spectral-core-v1.14.1
- @stoplight/spectral-core-v1.14.0
- @stoplight/spectral-core-v1.13.1
- @stoplight/spectral-core-v1.13.0
- @stoplight/spectral-core-v1.12.4
- @stoplight/spectral-core-v1.12.3
- @stoplight/spectral-core-v1.12.2
- @stoplight/spectral-core-v1.12.1
- @stoplight/spectral-core-v1.12.0
- @stoplight/spectral-core-v1.11.1
- @stoplight/spectral-core-v1.11.0
- @stoplight/spectral-core-v1.10.2
- @stoplight/spectral-core-v1.10.1
- @stoplight/spectral-core-v1.10.0
- @stoplight/spectral-core-v1.9.0
- @stoplight/spectral-core-v1.8.1
- @stoplight/spectral-core-v1.8.0
- @stoplight/spectral-core-v1.7.0
- @stoplight/spectral-core-v1.6.1
- @stoplight/spectral-core-v1.6.0
- @stoplight/spectral-core-v1.5.1
- @stoplight/spectral-core-v1.5.0
- @stoplight/spectral-core-v1.4.0
- @stoplight/spectral-core-v1.3.0
- @stoplight/spectral-core-v1.2.1
- @stoplight/spectral-core-v1.2.0
- @stoplight/spectral-core-v1.1.0
- @stoplight/spectral-core-v1.0.0
- @stoplight/spectral-core-1.19.4
- @stoplight/spectral-core-1.19.3
- @stoplight/spectral-core-1.19.2
- @stoplight/spectral-core-1.19.1
- @stoplight/spectral-core-1.19.0
- @stoplight/spectral-core-1.18.3
- @stoplight/spectral-core-1.18.2
- @stoplight/spectral-core-1.18.1
- @stoplight/spectral-cli-v6.8.0
- @stoplight/spectral-cli-v6.7.0
- @stoplight/spectral-cli-v6.6.0
- @stoplight/spectral-cli-v6.5.1
- @stoplight/spectral-cli-v6.5.0
- @stoplight/spectral-cli-v6.4.2
- @stoplight/spectral-cli-v6.4.1
- @stoplight/spectral-cli-v6.4.0
- @stoplight/spectral-cli-v6.3.0
- @stoplight/spectral-cli-v6.2.1
- @stoplight/spectral-cli-v6.2.0
- @stoplight/spectral-cli-v6.1.1
- @stoplight/spectral-cli-v6.1.0
- @stoplight/spectral-cli-v6.0.1
- @stoplight/spectral-cli-v6.0.0
- @stoplight/spectral-cli-v5.0.1
- @stoplight/spectral-cli-v5.0.0
- @stoplight/spectral-cli-v1.2.1
- @stoplight/spectral-cli-v1.2.0
- @stoplight/spectral-cli-v1.1.0
- @stoplight/spectral-cli-v1.0.0
- @stoplight/spectral-cli-6.14.2
- @stoplight/spectral-cli-6.14.1
- @stoplight/spectral-cli-6.14.0
- @stoplight/spectral-cli-6.13.1
- @stoplight/spectral-cli-6.13.0
- @stoplight/spectral-cli-6.12.0
- @stoplight/spectral-cli-6.11.1
- @stoplight/spectral-cli-6.11.0
- @stoplight/spectral-cli-6.10.1
- @stoplight/spectral-cli-6.10.0
- @stoplight/spectral-cli-6.9.0
Showing
16 changed files
with
584 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
267 changes: 267 additions & 0 deletions
267
src/rulesets/oas/functions/__tests__/refSiblings.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,267 @@ | ||
import { getLocationForJsonPath, parseWithPointers } from '@stoplight/json'; | ||
import { DiagnosticSeverity } from '@stoplight/types'; | ||
import { RuleType, Spectral } from '../../../../index'; | ||
import { rules as oasRules } from '../../../oas/index.json'; | ||
import refSiblings from '../refSiblings'; | ||
|
||
describe('refSiblings', () => { | ||
const s = new Spectral(); | ||
s.setFunctions({ refSiblings }); | ||
s.setRules({ | ||
'no-$ref-siblings': Object.assign(oasRules['no-$ref-siblings'], { | ||
recommended: true, | ||
type: RuleType[oasRules['no-$ref-siblings'].type], | ||
}), | ||
}); | ||
|
||
test('does not report anything for valid object', async () => { | ||
const results = await s.run({ | ||
swagger: '2.0', | ||
securityDefinitions: { | ||
apikey: {}, | ||
}, | ||
paths: { | ||
'/path': { | ||
get: { | ||
security: [ | ||
{ | ||
apikey: [], | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
expect(results.length).toEqual(0); | ||
}); | ||
|
||
test('reports $ref siblings for oas2 document', async () => { | ||
const doc = `{ | ||
"swagger": "2.0", | ||
"securityDefinitions": { | ||
"apikey": {}, | ||
"$ref": "#/securityDefinitions/apikey" | ||
}, | ||
"paths": { | ||
"$ref": "#/securityDefinitions/apikey", | ||
"/path": { | ||
"post": {}, | ||
"$ref": "#/foo/bar", | ||
"get": { | ||
"$ref": "#/da", | ||
"security": [ | ||
{ | ||
"apikey": [] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}`; | ||
|
||
const results = await s.run({ | ||
parsed: parseWithPointers(doc), | ||
getLocationForJsonPath, | ||
}); | ||
|
||
expect(results).toEqual([ | ||
{ | ||
code: 'no-$ref-siblings', | ||
message: '$ref cannot be placed next to any other properties', | ||
path: ['securityDefinitions', 'apikey'], | ||
range: { | ||
end: { | ||
character: 16, | ||
line: 3, | ||
}, | ||
start: { | ||
character: 14, | ||
line: 3, | ||
}, | ||
}, | ||
severity: DiagnosticSeverity.Error, | ||
}, | ||
{ | ||
code: 'no-$ref-siblings', | ||
message: '$ref cannot be placed next to any other properties', | ||
path: ['paths', '/path'], | ||
range: { | ||
end: { | ||
character: 5, | ||
line: 19, | ||
}, | ||
start: { | ||
character: 13, | ||
line: 8, | ||
}, | ||
}, | ||
severity: DiagnosticSeverity.Error, | ||
}, | ||
{ | ||
code: 'no-$ref-siblings', | ||
message: '$ref cannot be placed next to any other properties', | ||
path: ['paths', '/path', 'post'], | ||
range: { | ||
end: { | ||
character: 16, | ||
line: 9, | ||
}, | ||
start: { | ||
character: 14, | ||
line: 9, | ||
}, | ||
}, | ||
severity: DiagnosticSeverity.Error, | ||
}, | ||
{ | ||
code: 'no-$ref-siblings', | ||
message: '$ref cannot be placed next to any other properties', | ||
path: ['paths', '/path', 'get'], | ||
range: { | ||
end: { | ||
character: 7, | ||
line: 18, | ||
}, | ||
start: { | ||
character: 13, | ||
line: 11, | ||
}, | ||
}, | ||
severity: DiagnosticSeverity.Error, | ||
}, | ||
{ | ||
code: 'no-$ref-siblings', | ||
message: '$ref cannot be placed next to any other properties', | ||
path: ['paths', '/path', 'get', 'security'], | ||
range: { | ||
end: { | ||
character: 9, | ||
line: 17, | ||
}, | ||
start: { | ||
character: 20, | ||
line: 13, | ||
}, | ||
}, | ||
severity: DiagnosticSeverity.Error, | ||
}, | ||
]); | ||
}); | ||
|
||
test('reports $ref siblings for oas3 document', async () => { | ||
const doc = `{ | ||
"openapi": "3.0.0", | ||
"components": { | ||
"securityDefinitions": { | ||
"apikey": {}, | ||
"$ref": "#/components/securityDefinitions/apikey" | ||
} | ||
}, | ||
"paths": { | ||
"$ref": "#/components/securityDefinitions/apikey", | ||
"/path": { | ||
"post": {}, | ||
"$ref": "#/foo/bar", | ||
"get": { | ||
"$ref": "#/da", | ||
"security": [ | ||
{ | ||
"apikey": [] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}`; | ||
|
||
const results = await s.run({ | ||
parsed: parseWithPointers(doc), | ||
getLocationForJsonPath, | ||
}); | ||
|
||
expect(results).toEqual([ | ||
{ | ||
code: 'no-$ref-siblings', | ||
|
||
message: '$ref cannot be placed next to any other properties', | ||
path: ['components', 'securityDefinitions', 'apikey'], | ||
range: { | ||
end: { | ||
character: 18, | ||
line: 4, | ||
}, | ||
start: { | ||
character: 16, | ||
line: 4, | ||
}, | ||
}, | ||
severity: DiagnosticSeverity.Error, | ||
}, | ||
{ | ||
code: 'no-$ref-siblings', | ||
message: '$ref cannot be placed next to any other properties', | ||
path: ['paths', '/path'], | ||
range: { | ||
end: { | ||
character: 5, | ||
line: 21, | ||
}, | ||
start: { | ||
character: 13, | ||
line: 10, | ||
}, | ||
}, | ||
severity: DiagnosticSeverity.Error, | ||
}, | ||
{ | ||
code: 'no-$ref-siblings', | ||
message: '$ref cannot be placed next to any other properties', | ||
path: ['paths', '/path', 'post'], | ||
range: { | ||
end: { | ||
character: 16, | ||
line: 11, | ||
}, | ||
start: { | ||
character: 14, | ||
line: 11, | ||
}, | ||
}, | ||
severity: DiagnosticSeverity.Error, | ||
}, | ||
{ | ||
code: 'no-$ref-siblings', | ||
message: '$ref cannot be placed next to any other properties', | ||
path: ['paths', '/path', 'get'], | ||
range: { | ||
end: { | ||
character: 7, | ||
line: 20, | ||
}, | ||
start: { | ||
character: 13, | ||
line: 13, | ||
}, | ||
}, | ||
severity: DiagnosticSeverity.Error, | ||
}, | ||
{ | ||
code: 'no-$ref-siblings', | ||
message: '$ref cannot be placed next to any other properties', | ||
path: ['paths', '/path', 'get', 'security'], | ||
range: { | ||
end: { | ||
character: 9, | ||
line: 19, | ||
}, | ||
start: { | ||
character: 20, | ||
line: 15, | ||
}, | ||
}, | ||
severity: DiagnosticSeverity.Error, | ||
}, | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { JsonPath } from '@stoplight/types'; | ||
import { IFunction, IFunctionResult } from '../../../types'; | ||
|
||
// function is needed because `$..$ref` or `$..[?(@.$ref)]` are not parsed correctly | ||
// and therefore lead to infinite recursion due to the dollar sign ('$' in '$ref') | ||
function* siblingIterator(obj: object, path: JsonPath): IterableIterator<JsonPath> { | ||
const hasRef = '$ref' in obj; | ||
for (const key in obj) { | ||
if (!Object.hasOwnProperty.call(obj, key)) continue; | ||
const scopedPath = [...path, key]; | ||
if (hasRef && key !== '$ref') { | ||
yield scopedPath; | ||
} | ||
|
||
if (key !== '$ref' && typeof obj[key] === 'object' && obj[key] !== null) { | ||
yield* siblingIterator(obj[key], scopedPath); | ||
} | ||
} | ||
} | ||
|
||
const refSiblings: IFunction = (data: unknown) => { | ||
const results: IFunctionResult[] = []; | ||
if (typeof data !== 'object' || data === null) return results; | ||
|
||
for (const path of siblingIterator(data, [])) { | ||
results.push({ | ||
message: '$ref cannot be placed next to any other properties', | ||
path, | ||
}); | ||
} | ||
|
||
return results; | ||
}; | ||
|
||
export default refSiblings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters