JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Multiple params not allowed errors not returned in response

Open
#1,290 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.3k
Forks
546
PR merge metrics
No merged PRs in 30d

Description

This issue is a (choose one):

  • Problem/bug report.
  • Feature request.
  • Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead.

Checklist before submitting:

  • I've searched for an existing issue.
  • I've asked my question on Gitter and have not received a satisfactory answer.
  • I've included a complete bug report template. This step helps us and allows us to see the bug without trying to reproduce the problem from your description. It helps you because you will frequently detect if it's a problem specific to your project.
  • The feature I'm asking for is compliant with the JSON:API spec.

Description

Choose one section below and delete the other:

Bug reports:

When multiple invalid parameters are provided, only the first error is included in the response. This behavior changed in d177c228510e122ccb069c5f3eb3ad36b2261430: https://github.com/cerebris/jsonapi-resources/blob/a7447ac7d51dcc5c4d5ccc8a59bef5e4d3b744ea/lib/jsonapi/request_parser.rb#L629-L634

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/jsonapi/request_parser.rb around lines 629-634, the location linked in the report. Reproduce a request with multiple invalid parameters and inspect the response errors. Done means the response includes all invalid-parameter errors rather than only the first.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.