Closed tarekziade closed 7 years ago
JSON API deals with this by requiring the following JSON representation of a resource:
{
"data": {
"id": 123,
"type": "foo",
"attributes": {
"type": "whatever"
}
}
}
That is, a column named "type" would be represented as a "type" element under the "attributes" element in the JSON representation.
sorry I missed the attributes level. Thanks for the answer
Reading the code at https://github.com/jfinkels/flask-restless/blob/master/flask_restless/views/resources.py#L689
This assumes a SA mapping does not have a column named 'type' which I think it's possible. That would mean it would be impossible to update that field via a PATCH call.
Wouldn't it be safe to use a custom prefix to avoid name conflicts ? or move out of the 'data' mapping when the client sends data