You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
The ParameterNamesAnnotationIntrospector is added to the SetupContext using insertAnnotationIntrospector, so it takes precedence over the default JacksonAnnotationIntrospector (i.e. it is the primary AnnotationIntrospector in an AnnotationIntrospectorPair).
Because the ParameterNamesAnnotationIntrospector inherits findEnumValue from AnnotationIntrospector, when it inspects an enum value it just returns value.name()
Because the ParameterNamesAnnotationIntrospector didn't return null, the default JacksonAnnotationIntrospector doesn't get a chance to inspect the enum value (due to the behaviour of AnnotationIntrospectorPair).
We therefore use value.name() instead of the value of the @JsonProperty annotation.
I'd be happy to contribute a fix, but it's not obvious to me what the right way to fix this is (e.g. is this actually an issue with AnnotationIntrospectorPair?).
The text was updated successfully, but these errors were encountered:
Ah. Good catch, thank you for reporting this. I think it's a side-effect of a few things, obviously unintended.
I would have to look to know what would make sense wrt fix; I suspect part of the problem is that ideally AnnotationIntrospector should have very little handling, but due to backwards-compatibility (between JacksonAnnotationIntrospector, JAXBAnnotationIntrospector) that piece of functionality was added in there. Going forward it should be possible to move it out (esp. for 2.8), just not sure what the short-term solution would be.
I think I figured out the way to fix the problem, and changed code in jackson-databind (plus minor related change in JAXB modules); fix will be in 2.7.3.
If you annotate an enum value with @JsonProperty("foo"), that value should be serialized/deserialized as "foo". This fails if the parameter names module is registered - I've made a test case at https://github.com/edwag/jackson-parameter-names-test-case to clarify what I mean.
I believe that this is what happens:
I'd be happy to contribute a fix, but it's not obvious to me what the right way to fix this is (e.g. is this actually an issue with AnnotationIntrospectorPair?).
The text was updated successfully, but these errors were encountered: