Skip to content

RFC: Guide for handling generic filter/fieldset errors, such as empty inputs and 'undefined' #1452

@bf4

Description

@bf4

This issue is a (choose one):

  • Feature request.

Checklist before submitting:

  • I've searched for an existing issue.
  • The feature I'm asking for is compliant with the JSON:API spec.

Description

A JavaScript client has sent a request https://example.com/v1/books/1337?fields[books]=id,undefined
There are various possible approaches to raise a 400 on the invalid fieldset field undefined. It seems reasonable for JR to recommend some options.

Similarly, a JavaScript client has sent a request https://example.com/v1/books/1337?filter[published-on]=undefined
There are various possible approaches to raise a 400 on the invalid filter value undefined. It seems reasonable for JR to recommend some options.

Lastly, there are a number of cases where blank filter inputs can be considered invalid, such as https://example.com/v1/books/1337?filter[published-on]=&fields[books]=id. There are various possible approaches to raise a 400 on the invalid filter value '(empty)'. It seems reasonable for JR to recommend some options.

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