Skip to content

Allow custom primary key  #23

@mahenzon

Description

@mahenzon

There's an option to set custom url_field, but no way to do patch, because id is hardcoded

if "id" not in json_data["data"]:
raise BadRequest('Missing id in "data" node', source={"pointer": "/data/id"})
if str(json_data["data"]["id"]) != str(kwargs[getattr(self._data_layer, "url_field", "id")]):
raise BadRequest(
"Value of id does not match the resource identifier in url", source={"pointer": "/data/id"}
)

I know that another pk field is violation of JSON:API spec, but this feature would be neat

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions