Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
bf4 opened this issue Apr 8, 2024 · 0 comments
Open
3 tasks done

Comments

@bf4
Copy link
Collaborator

bf4 commented Apr 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant