Responds to the object itself
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the shown Grape::Entity class with expose :body and the present call, then compare it with the workaround that returns body explicitly. The work is done when the specified object itself can be presented without requiring that workaround; the issue does not name a file or test to update.
Written by the indexing model from the issue text.
Description
I want to respond to the specified object itself.
If you program as follows, you will get an error with no body method.
class BodyEntity < Grape::ENtity
expose :body
end
get do
present 'success', with: Entities::BodyEntity
end
As a workaround, we currently program as follows.
class BodyEntity < Grape::ENtity
expose :body do |body|
body
end
end
get do
present 'success', with: Entities::BodyEntity
end
Is not there a better way?
- Dominant language
- Ruby
- Stars
- 730
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from ruby-grape/grape-entity
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ruby-grape/grape-entity#386 · 7 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ruby-grape/grape-entity#382 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ruby-grape/grape-entity#380 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ruby-grape/grape-entity#373 · 2 comments ·
-
Truncate FormatterOpen
Difficulty 1/5 1-3 hours Newbie friendliness 45/100
ruby-grape/grape-entity#372 ·
All issues in ruby-grape/grape-entity
Similar issues
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
grafana/pyroscope#5729 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rubygems/rubygems.org#6895 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
samvera/hyku#3359 · 1 comment ·
Maintainers usually reply within 1 day
-
Child factories do not inherit traits from their parentPossibly taken @alassek claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rom-rb/rom-factory#99 ·