ArgumentError: coerce_with disallowed for type: JSON
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
If I want, for instance, to use Oj library to parse JSON, grape does not allow me to do so.
requires :json, type: Array[JSON], coerce_with: ->(raw) { Oj.load(raw) }
What are the reasons for that? Maybe we can allow custom coercions for JSON?
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
Start by tracing how Grape handles requires :json, type: Array[JSON], coerce_with: and why the supplied Oj.load coercion is rejected. The issue names no files or tests; done would require an agreed behavior for allowing or rejecting custom coercions for JSON and coverage for that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100