Skip to content
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

Inverse access of @JsonProperty(access=) so it can work differently on server side and client side #2951

Open
qianlong opened this issue Nov 20, 2020 · 1 comment · May be fixed by #2966
Open

Comments

@qianlong
Copy link

@JsonProperty's access mode should be inversed on server side and client side when both sides are sharing the same module class.

when using access = READ_ONLY with @JsonProperty, on the server side, that means property need to be serialized but can't be deserialized. but on the client side, the same property should be able to be deserialized but not to be serialized.

Is it good to have an out-of-box feature to do this inversion?

@qianlong qianlong added the to-evaluate Issue that has been received but not yet evaluated label Nov 20, 2020
@cowtowncoder
Copy link
Member

cowtowncoder commented Nov 20, 2020

Nothing to support it out-of-the-box, but you should be able to sub-class JacksonAnnotationIntrospector and override relevant methods to change the logic as necessary?

Or, alternatively, use mix-in annotations (but that may be more work for larger sets of types).

@cowtowncoder cowtowncoder removed the to-evaluate Issue that has been received but not yet evaluated label Nov 25, 2020
@ggrebert ggrebert linked a pull request Dec 2, 2020 that will close this issue
@cowtowncoder cowtowncoder changed the title inverse access of @JsonProperty so it can work differently on server side and client side inverse access of @JsonProperty(access=) so it can work differently on server side and client side Dec 2, 2020
@cowtowncoder cowtowncoder changed the title inverse access of @JsonProperty(access=) so it can work differently on server side and client side Inverse access of @JsonProperty(access=) so it can work differently on server side and client side Dec 2, 2020
@cowtowncoder cowtowncoder added 2.14 and removed 2.13 labels Jul 15, 2021
@cowtowncoder cowtowncoder removed the 2.14 label Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants