ruby-grape / grape-entity

An API focused facade that sits on top of an object model.
MIT License
715 stars 153 forks source link

Allow default exposed value to be `false` or any empty data #371

Closed norydev closed 1 year ago

norydev commented 1 year ago

Using present? limits what can be set as :default and restricts falsy values like false, '', [] for example.

I don't really see why not allow those (I have a use case for false for example, which is to ensure a nullable boolean value is always rendered as a boolean).

LeFnord commented 1 year ago

ok makes sense … thanks @norydev