-
Notifications
You must be signed in to change notification settings - Fork 157
Closed
Description
I can provide the following steps to reproduce, but I have not been able to understand yet what's causing the issue, so I wanted to open this ticket to flag it.
- Run the example api.py.
- Post a new object to /persons:
{
"data": {
"type": "person",
"attributes": {
"name": "Person1"
}
}
}
- Get the person's (empty) relationships object at /persons/1/relationships/computers
{
"links": {
"self": "/persons/1/relationships/computers",
"related": "/persons/1/computers"
},
"data": [],
"jsonapi": {
"version": "1.0"
}
}
- Post a new object to /persons
{
"data": {
"type": "person",
"attributes": {
"name": "Person2"
}
}
}
- Observe that the "relationships" -> "computers" -> "links" -> "related" url is incorrect (refers to person 1). That appears to stick through other permutations (subsequent gets), but depends on having queried previously for another person's relationships.
{
"data": {
"type": "person",
"id": "2",
"attributes": {
"display_name": "PERSON2 <None>",
"birth_date": null
},
"relationships": {
"computers": {
"links": {
"self": "/persons/2/relationships/computers",
"related": "/persons/1/computers"
}
}
},
"links": {
"self": "/persons/2"
}
},
"links": {
"self": "/persons/2"
},
"jsonapi": {
"version": "1.0"
}
}
I have not investigated deeply enough to understand why this is happening (or tested outside of the example sqlite), but wanted to open the issue in hopes the author can identify the problem since it definitely doesn't seem to match the JSONAPI spec or desired behavior.
Metadata
Metadata
Assignees
Labels
No labels