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
First off, I have created a test repository on github where you can see this for yourself, either in the github action runs or by checking it out locally and running mvn test: jackson-annotation-processing-experiment.
It seems that as soon as one specifies a @JacksonXmlProperty annotation on a java record property, then one has to supply the localName argument to the annotation, otherwise, when deserializing an xml document into the record representation, you get a "Duplicate creator property" error. This is different behavior than @JsonProperty, which one can specify on a record without supplying it any arguments and it works just fine.
I am aware that one can simply not add any annotation, and deserialization works just fine. I noticed this issue though when trying to use isAttribute=true on a @JacksonXmlProperty on a java record, as an xml document I need to deserialize uses attributes. I am also aware that once you specify localName, deserialization also works. What puzzles me is that the simple presence of a @JacksonXmlProperty annotation on a java record seems to require the specification of localName, whereas this does not appear to be the case for @JsonProperty.
Any help or tips or ideas you have would be greatly appreciated!
And of course thanks for making such an awesome tool for us, and I realize you owe me absolutely nothing but if you do happen to get a moment to look at this, it would be super cool!
The text was updated successfully, but these errors were encountered:
Quick note -- and apologies for a slow follow-up -- since Property introspection handling was rewritten in 2.18.0, it might make sense to verify the issue still occurs with 2.18.0-SNAPSHOT versions, as there's a slight chance things might have improved.
If nothing else, that would rule out possibility of a recent indirect fix.
Hello there,
First off, I have created a test repository on github where you can see this for yourself, either in the github action runs or by checking it out locally and running mvn test: jackson-annotation-processing-experiment.
It seems that as soon as one specifies a
@JacksonXmlProperty
annotation on a java record property, then one has to supply thelocalName
argument to the annotation, otherwise, when deserializing an xml document into the record representation, you get a "Duplicate creator property" error. This is different behavior than@JsonProperty
, which one can specify on a record without supplying it any arguments and it works just fine.I am aware that one can simply not add any annotation, and deserialization works just fine. I noticed this issue though when trying to use isAttribute=true on a
@JacksonXmlProperty
on a java record, as an xml document I need to deserialize uses attributes. I am also aware that once you specifylocalName
, deserialization also works. What puzzles me is that the simple presence of a@JacksonXmlProperty
annotation on a java record seems to require the specification oflocalName
, whereas this does not appear to be the case for@JsonProperty
.Any help or tips or ideas you have would be greatly appreciated!
And of course thanks for making such an awesome tool for us, and I realize you owe me absolutely nothing but if you do happen to get a moment to look at this, it would be super cool!
The text was updated successfully, but these errors were encountered: