ruby-grape / ruby-grape/grape-swagger

Should the minimum, maximum values be only Integer type?

Open
#904 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1.1k
Forks
479
Avg merge
2d 14h
Merged PRs (30d)
6

Description

https://github.com/ruby-grape/grape-swagger/blob/3a5da56fb3ad19dcb07cf3ef86549bb811e22dcc/lib/grape-swagger/doc_methods/parse_params.rb#L165C67-L165C67

As described in https://docs.swagger.io/spec.html

minimum | string | number, integer | The minimum valid value for the type, inclusive. If this field is used in conjunction with the defaultValue field, then the default value MUST be higher than or equal to this value. The value type is string and should represent the minimum numeric value. Note: This will change to a numeric value in the future.

The values may be number (float or double). Should be the validation be removed?

 ... if values.first.is_a?(Integer) 

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.

Research direction

Read lib/grape-swagger/doc_methods/parse_params.rb around line 165 and compare the minimum and maximum handling with the referenced Swagger specification. Determine whether numeric float and double values should be accepted alongside integers; done means the behavior matches the specification for the described values.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.