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

`with_options` doesn't do deep merge

Open
#284 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start at the with_options entry point and trace how parent and nested documentation options are combined. Reproduce the example from the issue, then add a regression test showing that nested attributes retain required and type while adding example values. Done means the nested documentation is deep-merged rather than replaced.

Written by the indexing model from the issue text.

Description

      with_options documentation: {required: true, type: 'integer'} do
        expose :posts_count, as: :posts, documentation: {example: 7}
        expose :followers_count, as: :followers, documentation: {example: 105}
        expose :following_count, as: :following, documentation: {example: 52}
        expose :bookmarks_count, as: :bookmarks, documentation: {example: 22}
      end

the example doesn't work, since documentation from nested attributes overrides parent's one.

I think they should be deep merged

Dominant language
Ruby
Stars
730
Forks
155
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.