Skip to content

Commit

Permalink
Ensure consistency in declaring "id" as "string"
Browse files Browse the repository at this point in the history
  • Loading branch information
seanpdoyle committed Apr 5, 2019
1 parent 33c485f commit 29a1a87
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions spec/json_matchers/match_json_schema_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
expect(json).to match_json_schema("api/v1/schema")
end

it "Fails properly in local refs in referenced schema" do
it "supports invalidating the referenced schema when using local references" do
create(:schema, name: "post", json: {
"$schema": "https://json-schema.org/draft-04/schema#",
"id": "file:/post.json#",
Expand All @@ -71,7 +71,7 @@
"name",
],
"properties": {
"id": { "type": "number" },
"id": { "type": "string" },
"name": { "type": "string" }
}
}
Expand All @@ -83,7 +83,7 @@
"attributes"
],
"properties": {
"id": { "type": "number" },
"id": { "type": "string" },
"type": { "type": "string" },
"attributes": {
"$ref": "#/definitions/attributes",
Expand Down Expand Up @@ -114,10 +114,10 @@

json = build(:response, {
"data": [{
"id": "1",
"id": 1,
"type": "Post",
"attributes": {
"id": "1",
"id": 1,
"name": "The Post's Name"
}
}]
Expand Down Expand Up @@ -146,15 +146,15 @@
"name",
],
"properties": {
"id": { "type": "integer" },
"id": { "type": "string" },
"name": { "type": "string" },
"user": {
"type": "object",
"required": [
"id",
],
"properties": {
"id": { "type": "integer" },
"id": { "type": "string" },
},
},
},
Expand Down Expand Up @@ -188,10 +188,10 @@
"id": "1",
"type": "Post",
"attributes": {
"id": 1,
"id": "1",
"name": "The Post's Name",
"user": {
"id": 1
"id": "1"
}
}
}],
Expand Down

0 comments on commit 29a1a87

Please sign in to comment.