Custom Entity options support
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start in lib/grape_entity/entity.rb at valid_options, around line 624, and review how expose options are validated. Reproduce the shown :custom ArgumentError, then determine how arbitrary named options should be accepted for entity exposure; done means the example and other option names no longer raise that validation error.
Written by the indexing model from the issue text.
Description
It would be great to be able to provide custom options for entity exposure like:
expose :name, custom: { key: 'value' }
Not only option named custom but any other name as well. It might be helpful sometimes
Now such custom options not allowed ant an exception is throwing:
/gems/grape-entity-1.0.0/lib/grape_entity/entity.rb:624:in `block in valid_options': :custom is not a valid option. (ArgumentError):
raise ArgumentError, "#{key.inspect} is not a valid option." unless OPTIONS.include?(key)
- 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#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 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
ruby-grape/grape-entity#370 ·
All issues in ruby-grape/grape-entity
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
forem/forem#23933 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rails/mission_control-jobs#347 ·
-
PROJECT: ILR/DRS
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
thewca/worldcubeassociation.org#15914 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 7 days
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
benbalter/site-inspector#127 ·
Maintainers usually reply within 1 day