how to define multiple allowed types with values?
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 10k
- Forks
- 1.2k
- Avg merge
- 14h 38m
- Merged PRs (30d)
- 92
Description
Let say I have an API parameter, I wanna the parameter accept a boolean or a string
optional :status, types: [Boolean, String]
As I wanna scoped the string value, but I found that I cant define as below
optional :status, types: [Boolean, String], values: %w(active hidden draft)
May I know how to achieve this objective?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no file, test, or entry point. Start by tracing how Grape handles optional parameters with multiple types and values, then clarify the expected validation behavior for booleans and the three listed strings; done means that behavior is specified and covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 18/100