default_error_status does not inherit from its mounted parent
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 10k
- Forks
- 1.2k
- Avg merge
- 14h 38m
- Merged PRs (30d)
- 92
Description
class Api::Base < Grape::API
default_error_status 400
mount Api::Status
end
error! inside Api::Status would respond with 500
It's not very clear, some of the configs are inherited when mounted, and some like default_error_status are not.
Grape tutorials suggest using 'Defaults' concern which is included in each api class. That looks strange to have such complexity for such simple use case of inheriting options
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 mount handles configuration inheritance between Api::Base and Api::Status, focusing on default_error_status and error!. Compare this behavior with the other configurations that are inherited when mounted. Done means error! inside the mounted API responds with the parent’s configured 400 status, with coverage for the mounted case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100