Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants