Skip to content

Invalid compound IDs lead to 400, should be 404 #2211

@lsmith77

Description

@lsmith77

Description and expected behavior
In case of using a compound ID on a model, a 400 error is returned when the supplied ID is missing chunks for any column.

ie. if the correct URL for a resource is /user/a_b on a constraint with 2 columns, when /user/a is called it leads to a 400 due to an error thrown from prisma.findUnique() receiving undefined in the where filter.

Screenshots
Image

Environment (please complete the following information):

  • ZenStack version: 2.17.2
  • Prisma version: 6.10.0
  • Database type: MariaDB

Additional context
Issue was initially discovered in #2188

Some tentative approaches for fixes #2188 (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