Skip to content

Conversation

@RooHoo33
Copy link

@RooHoo33 RooHoo33 commented Nov 18, 2025

I found an bug recently in a Micronaut application I was writing where I was using the custom Micronaut object mapper, if a Kotlin class is annotated with @Introspected and the json payload is missing a primitive field, the class property's default value is ignored and the Jackson default primitive value is used. The Micronaut bean instantiation feature already supports instantiating a Kotlin class that has optional/default properties which this fix uses. If the parameter's constructor argument is not required and there is no value from the json payload in the value buffer, instead of having Jackson determine the default the primitive value, we just use null and have the bean instantiation functionality take over and use the default property value.

This is my first pr to the project and I wasnt sure if I needed to create an issue before submitting a pr. If that is required, I can totally do that! Thanks!

@CLAassistant
Copy link

CLAassistant commented Nov 18, 2025

CLA assistant check
All committers have signed the CLA.

@RooHoo33 RooHoo33 marked this pull request as ready for review November 18, 2025 03:16
…rty is missing and fail on null for primitives in set to true
@sdelamo sdelamo requested a review from dstepanov November 19, 2025 13:20
@sdelamo sdelamo added the lang: kotlin Issues or features specific to Kotlin label Nov 19, 2025
@dstepanov
Copy link
Contributor

@yawkat Did you say that you want to remove the bean introspection support for Jackson?

@yawkat
Copy link
Member

yawkat commented Nov 20, 2025

Yes.

@graemerocher
Copy link
Contributor

maybe target 4.10.x it can be considered there

@RooHoo33
Copy link
Author

Will do, I originally targeted 4.10.x before realizing 5.0.x was suppose to be released soon. Should I close this pr and open anther one for 4.10.x instead?

@RooHoo33
Copy link
Author

RooHoo33 commented Dec 1, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang: kotlin Issues or features specific to Kotlin

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants