• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 5456930725
97%

Build:
DEFAULT BRANCH: master
Ran 04 Jul 2023 04:45PM UTC
Jobs 20
Files 203
Run time 6s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
5456930725

push

github

web-flow
Fix unknown validator exception when using requires/optional with Entity (#2338)

* Fix crash when using requires/optional with Entity

when that entity specifies keywords that grape interprets as custom validators, ie: is_array, param_type, etc.

This PR changes it so that it skips looking for a custom validator for those special documentation keywords.

This allows you to do something like:

```rb
desc 'Create some entity',
     entity: SomeEntity,
     params: SomeEntity.documentation
params do
  requires :none,
           except: %i[field1 field2],
           using:
             SomeEntity.documentation
end
post do
 ...
end
```

and SomeEntity can specify documentation like:

```rb
      class SomeEntity < Grape::Entity
        expose :id, documentation: { type: Integer, format: 'int64', desc: 'ID' }
        expose :name, documentation: { type: String, desc: 'Name', require: true, param_type: 'body' }
        expose :array_field,
               documentation: {
                 type: String,
                 desc: 'Array Field',
                 require: true,
                 param_type: 'bold'
               }
      end
```

and it won't crash on startup and give you correct documentation and param validation to boot.

Open questions:
1. Is this an exhaustive list of keywords?
2. Is there a better way to maintain/get the list of keywords?
3. Is there a better approach altogeher?

* Cleanup code and add to existing tests that fail without these changes.

* Update after merge with master

* PR feedback

6 of 6 new or added lines in 2 files covered. (100.0%)

15092 of 15238 relevant lines covered (99.04%)

786.1 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-2.7-multi_xml - 5456930725.1 04 Jul 2023 04:45PM UTC 0
75.0
GitHub Action Run
2 run-3.0-rails_7_0 - 5456930725.2 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
3 run-3.1-rails_6_0 - 5456930725.3 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
4 run-3.0-rails_6_1 - 5456930725.4 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
5 run-3.2-rails_6_1 - 5456930725.5 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
6 run-3.0-rack_2_0 - 5456930725.6 04 Jul 2023 04:45PM UTC 0
48.52
GitHub Action Run
7 run-3.1-rails_6_1 - 5456930725.7 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
8 run-3.1-rails_7_0 - 5456930725.8 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
9 run-2.7-rack_2_0 - 5456930725.9 04 Jul 2023 04:45PM UTC 0
48.52
GitHub Action Run
10 run-2.7-rack_1_0 - 5456930725.10 04 Jul 2023 04:45PM UTC 0
98.99
GitHub Action Run
11 run-2.7-rails_7_0 - 5456930725.11 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
12 run-3.2-rails_6_0 - 5456930725.12 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
13 run-3.2-rack_2_0 - 5456930725.13 04 Jul 2023 04:45PM UTC 0
48.52
GitHub Action Run
14 run-2.7-multi_json - 5456930725.14 04 Jul 2023 04:45PM UTC 0
77.78
GitHub Action Run
15 run-2.7-rails_6_1 - 5456930725.15 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
16 run-3.2-rails_7_0 - 5456930725.16 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
17 run-3.0-rails_6_0 - 5456930725.17 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
18 run-3.1-rack_2_0 - 5456930725.18 04 Jul 2023 04:45PM UTC 0
48.52
GitHub Action Run
19 run-2.7-rails_6_0 - 5456930725.19 04 Jul 2023 04:45PM UTC 0
99.01
GitHub Action Run
20 run-2.6-rails_5_2 - 5456930725.20 04 Jul 2023 04:45PM UTC 0
98.96
GitHub Action Run
Source Files on build 5456930725
Detailed source file information is not available for this build.
  • Back to Repo
  • 8e1488d6 on github
  • Prev Build on master (#5449198434)
  • Next Build on master (#5929516647)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc