Skip to content

Allow configuring an expected ID when unmarshaling #78

Description

@jwreschnig-utiq

Is your feature request related to a problem? Please describe.
I would like the package to support in the common ID validation when processing PATCH data, i.e. that the ID in the document matches the one in the URL path.

Describe the solution you'd like
A UnmarshalExpectedID configuration option that generates an error if the ID does not match or it was a multiple data document.

Describe alternatives you've considered
Because the unmarshaler is private it is difficult to add new functional options in client code without wrapping all existing functional options.

Additional context
I have a full PR ready implementing this function, with tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions