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

Don't include write only properties in serialization #8457

Merged
merged 1 commit into from
Dec 2, 2022

Conversation

graemerocher
Copy link
Contributor

@graemerocher graemerocher commented Dec 2, 2022

When using the bean introspection module it is possible that write only properties are including for serialization leading to:

 Caused by: java.lang.UnsupportedOperationException: Cannot read from a write-only property
  	at io.micronaut.inject.beans.AbstractInitializableBeanIntrospection$BeanPropertyImpl.get(AbstractInitializableBeanIntrospection.java:425)
  	at io.micronaut.jackson.modules.BeanIntrospectionModule$BeanIntrospectionPropertyWriter.serializeAsField(BeanIntrospectionModule.java:875)
  	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774)

@graemerocher graemerocher added the type: bug Something isn't working label Dec 2, 2022
@graemerocher graemerocher added this to the 4.0.0 milestone Dec 2, 2022
@sonarcloud
Copy link

sonarcloud bot commented Dec 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

80.0% 80.0% Coverage
0.0% 0.0% Duplication

@graemerocher graemerocher merged commit d78efca into 4.0.x Dec 2, 2022
@graemerocher graemerocher deleted the jackson-introspection-module-bug branch December 2, 2022 20:28
graemerocher added a commit that referenced this pull request Dec 15, 2022
* Don't include write only properties in serialization (#8457)

Co-authored-by: yawkat <jonas.konrad@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants