Closed pelted closed 8 years ago
I think you confuse the top level attributes
property definition with the nested attributes
within the data
property.
Your response is valid w.r.t. to the schema because the only thing it requires for a property of name attributes
within the data
property is to be an object, which it is.
Your expectation would hold if you had a response like this:
{
"data":{
"id": "1",
"type": "users"
},
"attributes": {
"user_name": "admin",
"email":"admin@example.com"
}
}
Complete fail on my part it would appear. Many examples I found seem to show the schema nested properties outside of the object but your response pretty much cleared it all up for me. I wonder then if the new reference to #178 from 3 days ago is something similar.
Given the simple schema bellow it is expected to not validate because of the
foo
required key in the nested attributes object but it in fact does validate when the response does not containfoo
.Doing some digging, it appears the reason may have to do with the
id
property being returned in the response.Schema
Response