This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
marshmallow-jsonapi tries to build self links, even if id
is None
#249
Labels
id
is None
#249
I have the following (simplified) schema:
I'm writing unit tests for my REST API, and thus I want to generate some sample data, dump it using this schema, send it in a POST request, and check that everything works. However, because I am constructing new data here, I naturally have no
id
for this field. This is accepted by the JSON API spec, in a request, although not a response. However, when dumping, marshmallow-jsonap still tries to construct the self links, and thus tries to use theid
field (which isNone
), and I end up with this error:Is there any way to skip link generation when there is no
id
? Or any way to skip link generation at all? I think it would be nice to have some kind of flag that tells marshmallow that this schema is for creating a request, and so to dump a simplified version of the data, without relationships and links and IDs and such.The text was updated successfully, but these errors were encountered: