Closed sunnydesign closed 3 years ago
Yes, following the spec on https://jsonapi.org/ you are not allowed to use a type
attribute inside your attributes
object. This, because there is already a type
element in your resource object.
https://jsonapi.org/format/#document-resource-object-fields
A resource object’s attributes and its relationships are collectively called its “fields”.
Fields for a resource object MUST share a common namespace with each other and with
type
andid
. In other words, a resource can not have an attribute and relationship with the same name, nor can it have an attribute or relationship namedtype
orid
.
Thanks, I read it.
When I create a resource with attribute name "type" and try to send a POST request with payload:
I get an error: