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

self_url_kwargs should come from object, not schema #276

Open

Description

@fhriley

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.

Activity

  1. multimeric commented on Dec 6, 2019

    @multimeric

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

  2. fhriley commented on Dec 6, 2019

    @fhriley
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions