Closed lironesamoun closed 3 years ago
Hi! The meta
object exists for exactly this kind of scenario - it contains "non-standard meta-information about a resource that can not be represented as an attribute or relationship."
For resource objects we only support the top-level keys defined in the specification, so you should use the meta
key in this scenario.
In addition: Putting custom attributes at the same level as type
and id
is forbidden in the JSONAPI standard: https://jsonapi.org/. You should put them in attributes
if it is part of your model. If it isn't, it should be in meta
.
Hi,
I would like to add for example a key-value at the same level of type and Id like here:
Is it possible to do so ? Why ? Because the date time is not part of my house object and it is something important for me to add. I was thinking to put it in meta but maybe it's better at the same level of ID and type.
Any insight ? What do you think ?
Thank you very much