Open Ramblurr opened 7 years ago
Remo @remmeier 16:45 I would say the attribute should not be created in the first place. MetaDataObjectImpl.initAttributes is the place to prevent that.
I am all for reusing @JsonIgnore
On Thu, Dec 15, 2016 at 8:41 AM Casey Link notifications@github.com wrote:
Remo @remmeier https://github.com/remmeier 16:45 I would say the attribute should not be created in the first place. MetaDataObjectImpl.initAttributes is the place to prevent that.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/katharsis-project/katharsis-framework/issues/258#issuecomment-267376320, or mute the thread https://github.com/notifications/unsubscribe-auth/ABaI0Cgq3W-28Q-EaNW48L97xKRRqePVks5rIW3AgaJpZM4LOPEY .
Any update on this? I'm trying to modify isIgnored() but then I discovered it simply ignore both the getter and setter, which is not what I want (I have a password field that should only allow setter exposed to the api)
What you're looking for is a write-only field, and there currently isn't a way to implement that with the API.
This ticket is about ignoring internal fields entirely (the whole field, both getter and setter).
In our katharsis project we work around this by having an empty getter/setter on our resource objects for read/write only fields respectively.
This only works because our katharsis resources are DTOs that are mapped onto JPA entities.
Currently the
isIgnored
method inJpaResourceInformationBuilder
is not fully implemented:It should be implemented to detect fields that should be ignored.
@JsonIgnore
is the best candidate when it comes to existing annotations.Optionally a new katharsis-jpa specific annotation could be used, but I don't think that is the best choice.
I'd implement this myself, but I got lost in the maze of
Meta*
classes. I couldn't see how to access the annotations via aMetaAttribute
reference.