Is this sample in a correct format based on JSON API specifications? In another word can we have in attributes an array?
{
"meta": {
},
"links": {
"self": ""
},
"jsonapi": {
"version": "",
"meta": {
}
},
"data": {
"type": "typeof(class)",
"id": "string",
"attributes": [
{
"item1": "Value1",
"item2": "Value2",
"item3": "Value3"
}
],
"links": {
"self": ""
}
}
}
I am not sure even after reading that (link) If correct how can I Deserialize it I am using JSONAPISerializer package in C#
Your example is invalid.
The value of the
attributes
key in a resource object must be an attributes object. It must not be an array as in your example:The value of a specific attribute may be a complex data structure:
But that would be something different than the example you have given. It would look like this instead:
In the example given above
foo
would be an attribute, which has a complex data structure as a value.