Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Custom Entity options support

Open
#382 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
api

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ruby-grape/grape-entity

All issues in ruby-grape/grape-entity

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.