Set fail_fast to true by default

Open
#1,654 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
api

Research direction

Start by locating the fail_fast option and the validation tests that define its current behavior. Review how the default is configured and how multiple invalid parameters are reported. Done means the intended default behavior is agreed, implemented consistently, and covered by tests without breaking existing API expectations.

Written by the indexing model from the issue text.

Description

feature request

I would like to set this option to true for my entire API. Before I create a PR with such an ability, I would like to discuss it. In my opinion, when a parameter is considered invalid, there is no sense in running another validators, because:

  1. request will not be processed normally anyway
  2. we spent time and cpu on useless validation

So, I think we should change behavior of validation to stop after first invalid parameter.

Dominant language
Ruby
Stars
10k
Forks
1.2k
Avg merge
14h 38m
Merged PRs (30d)
92

Contributor guide

Open the contributing guide

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.

More from ruby-grape/grape

All issues in ruby-grape/grape

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.