grape-entity
grape-entity copied to clipboard
How to expose all fields by default?
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.
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.