ruby-grape / ruby-grape/grape-entity

Type boolean in grape entity is not working with default

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

Nobody has claimed this yet.

bug?
Dominant language
Ruby
Stars
729
Forks
154
PR merge metrics
No merged PRs in 30d

Description

Hi, This code is not working

expose :active, documentation: { type:  'boolean', default: true, desc: 'If the code can be used'}

It is generating a schema as {"active": false}. Any Thing wrong with code?

Contributor guide

Open the contributing guide

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.

Research direction

Start by reproducing the reported expose :active declaration and inspect the schema-generation path for boolean documentation defaults. Confirm the behavior with a focused regression test; the work is done when the generated schema contains active: true for the shown declaration.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.