Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
shockey committed Apr 28, 2017
1 parent 84b77c2 commit 004201b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ export function validate({ jsSpec }) {
///// $ref siblings
return keys.map(k => {
if(keys.indexOf("$ref") > -1 && k !== "$ref") {
errors.push({
warnings.push({
path: path.concat([k]),
message: "Sibling values are not allowed alongside a $ref."
message: "Values alongside a $ref will be ignored."
})
}
return walk(value[k], [...path, k])
Expand Down
8 changes: 4 additions & 4 deletions test/plugins/validation/semantic/walker.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ describe("validation plugin - semantic - spec walker", () => {

describe("Ref siblings", () => {

it("should return an error when another property is a sibling of a $ref", () => {
it("should return a warning when another property is a sibling of a $ref", () => {
const spec = {
paths: {
"/CoolPath/{id}": {
Expand All @@ -380,9 +380,9 @@ describe("validation plugin - semantic - spec walker", () => {
}

let res = validate({ jsSpec: spec })
expect(res.errors.length).toEqual(1)
expect(res.errors[0].path).toEqual(["paths", "/CoolPath/{id}", "schema", "description"])
expect(res.warnings.length).toEqual(0)
expect(res.errors.length).toEqual(0)
expect(res.warnings.length).toEqual(1)
expect(res.warnings[0].path).toEqual(["paths", "/CoolPath/{id}", "schema", "description"])
})

})
Expand Down

0 comments on commit 004201b

Please sign in to comment.