grape-entity icon indicating copy to clipboard operation
grape-entity copied to clipboard

How to expose all fields by default?

Open greggilbert opened this issue 9 years ago • 1 comments

Hey. Is there a way to expose all fields by default, and only unexpose certain ones? For example, suppose I have a User class that I want to present, but I don't want to show the hashed password field. I don't see it in the docs, but it's possible I missed something.

greggilbert avatar Jun 02 '16 04:06 greggilbert

Not possible today. Generally the library encourages explicit declaration of all fields being exposed, to avoid side effects or other automatic behavior. You can definitely implement a helper that iterates through fields and calls expose on them, that's something that could be possibly useful here, I'll keep it open.

dblock avatar Jun 02 '16 10:06 dblock