Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

self_url_kwargs should come from object, not schema #276

Open
fhriley opened this issue Dec 5, 2019 · 2 comments
Open

self_url_kwargs should come from object, not schema #276

fhriley opened this issue Dec 5, 2019 · 2 comments

Comments

@fhriley
Copy link

fhriley commented Dec 5, 2019

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.

@multimeric
Copy link

I'm not sure I'm understanding correctly, but is this a duplicate of my issue, #247?

@fhriley
Copy link
Author

fhriley commented Dec 6, 2019

This looks like the same issue, but #247 is on self_view_kwargs. They should probably be fixed together.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants