Closed
Description
If a model has an id column that's an integer primary key
class Person(models.Model):
id = models.IntegerField(primary_key=True)
name = models.CharField(max_length=200)
and a fixture is loaded where the id has value 0
[
{"model": "project.person", "fields": {"id": 0, "name": "Example"}},
{"model": "project.person","fields": {"id": 1, "name": "Someone"}}
]
then the JSON response returned from the API replaces the id of 0 with null
"data": [
{
"type": "person",
"id": null,
"attributes": {
"name": "Example"
}
},
{
"type": "person",
"id": "1",
"attributes": {
"name": "Someone"
}
}
],