Rabl not running for DELETE
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 10k
- Forks
- 1.2k
- Avg merge
- 14h 38m
- Merged PRs (30d)
- 92
Description
I am in the process of upgrading an old Rails app. Just tried increasing Grape from version 0.17.0 to 0.19.2. I hit on issue with the rabl no longer being processed for DELETE.
My API looks like:
desc 'Disable to send push notification'
delete '/push_notifiable', rabl: 'rooms/push_notifiable' do
@room = Room.find(params[:room_id])
@push_notifiable = false
end
And the test that now fails looks a bit like:
describe 'DELETE /rooms/:room_id/push_notifiable' do
subject { delete url, params: params }
it 'returns 200 status, and correct json' do
subject
expect(response.status).to eq 200
expect(json['room']['room_type']).to eq 'XXXX'
end
end
The status test passes, but the response body is no longer the JSON generated by my rabl, just simply the string false.
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
Use the shown DELETE route with the rabl option and the failing DELETE /rooms/:room_id/push_notifiable test as the reproduction. Trace why the response body becomes the string false after the Grape upgrade; done means the request still returns status 200 and the JSON generated by the rooms/push_notifiable Rabl template.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100