micronaut-projects / micronaut-serialization

Build Time Serialization APIs for Micronaut
Apache License 2.0
26 stars 19 forks source link

@JsonCreator being ignored on internal enums #882

Closed KazimirDobrzhinsky closed 3 months ago

KazimirDobrzhinsky commented 3 months ago

Expected Behavior

@JsonCreator annotation shall be used, if you use it on the enum, which is internal for the class

Actual Behaviour

No response

Steps To Reproduce

When the enum is inside of the other class and fromValue method is marked as '@JsonCreator', this static fromValue method is ignored and the valueOf() enum method is used instead

Environment Information

Java 21 Micronaut parent 4.5.0

Example Application

No response

Version

4.5.0

dstepanov commented 3 months ago

Please create a sample app. Make sure the enum is annotated with @Serdeable

KazimirDobrzhinsky commented 3 months ago

That was a problem and I am extremely sorry for this ticket. I used Serdeable only on the outer class and therefore it didn't work.