-
Notifications
You must be signed in to change notification settings - Fork 68
self links are constructed using the dumped data, not the original input #247
Comments
Note: this is the same error as #224 |
We could do this by generating the link objects in a |
@TMiguelT Thanks for reporting all these issues and your workarounds. Unfortunately, I don't have much time to look into these, as I'm not using this project at work, and I'm busy with core marshmallow development in my free time. Feel free to send PRs; I can merge and release them as they come. |
That's fine, I totally understand. I'm just putting them here so that they're better documented so I or someone else can solve them down the track. And the workarounds might help people in the meantime. Please don't feel like I'm demanding that they be fixed or anything. |
Incidentally, I think the best way to solve this would be to make |
I have the following schema:
A model:
And a view function:
However, when I hit the view endpoint, I get this error:
So, from the last line it's obvious that marshmallow-jsonapi is trying to pull the field
sample_id
from the dumped data, since it has anid
field, which was not on the original model. However, this makes very little sense to me. We often want to generate a link using the model, but not to include the foreign key in the final data. Shouldn't we generate the self links using the original record, like we do for relationship links?The text was updated successfully, but these errors were encountered: