Fail to mount an API with default values on mutually_exclusive params
Open
Nobody has claimed this yet.
feature request
- Dominant language
- Ruby
- Stars
- 10k
- Forks
- 1.2k
- Avg merge
- 14h 38m
- Merged PRs (30d)
- 92
Description
Definition:
params do
optional :folder, type: String, default: nil
optional :tag, type: Array, default: nil
exactly_one_of :folder, :tag
end
header:
Content-Type: application/json;
request body:
{
"tag": [1,2,3]
}
or
{
"folder": "/hello"
}
got:
{
"error": "folder, tag are mutually exclusive"
}
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
Reproduce the issue using the shown params block, exactly_one_of declaration, Content-Type header, and request bodies. Start at the parameter validation path for defaults and mutually exclusive parameters; done means either valid request mounts successfully and the regression is covered for both folder and tag bodies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100