Skip to content

Resource Creation: Server-Side generated ID's #23

@chris-doehring

Description

@chris-doehring

Hi,

The JSON:API protocol accepts both server and client side generated resource IDs. This implements, that a resource id can be left out when executing the create resource request (see the protocol docs for reference).

Unfortunately, the ResourceInterface expects the ID to be a string, so the only solution for a server-side generated ID would be to submit an empty ID string. In my case this breaks the server-side validation, as the server correctly assumes a non-existing id resource member.

I guess the only correct solution would be to make the id function nullable in the ResourceInterface, which will break other stuff. I must find another temporary solution for this in order to proceed without adjusting the server-side validation.

Are there any plans to support the server-side generated ID's in this package? Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions