-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Properties without setter are read-only #85
Comments
The accessor annotation just changes the way the value is retrieved. If you need to exclude something, then you can use the @exclude annotation on the id property, or a custom exclusion strategy. |
|
I understand your proposal, but it's a different layer. Maybe serialization groups would help you, or we could add another annotation, sth like @readonly. |
So there's no solution for this right now? I want the exact same thing and @exclude wont help because I want it when I serialize the object. |
Another way of fixing this would be by removing the exception and just return.
Maybe making it optional via config? |
When I set the annotation
@Accessor(getter="foo")
on a property I expect this property to be read-only.Example:
Result:
I could skip some validation/cleaning logic if
id
is never set bydeserialize
.The text was updated successfully, but these errors were encountered: