marshmallow-jsonapi
marshmallow-jsonapi copied to clipboard
self_url_kwargs should come from object, not schema
related_url_kwargs
are pulled from object data. self_url_kwargs
are pulled from schema data. This is inconsistent (I got bit by it the first time I tried using self_url_kwargs
). Furthermore, it means that all kwargs
used in self_url_kwargs
must be serialized as part of the schema, which I don't always want to do. For example:
class Meta:
type_ = "bars"
self_url = "/foos/{foo_id}/bars/{bar_id}"
self_url_kwargs = {"foo_id": "<foo_id>, "bar_id": "<id>"}
I don't want foo_id
to be serialized in a bars
schema.
I'm not sure I'm understanding correctly, but is this a duplicate of my issue, #247?
This looks like the same issue, but #247 is on self_view_kwargs
. They should probably be fixed together.