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
This is because (I believe) Jackson ignores the @XmlEnum annotation. I would like the outputted snippet to have "type" : "integer" (or int? I'm not 100% sure which it is). I'm going to attempt to write the functionality myself, but would appreciate any pointers on where to get started, or a head-up if I'm just wrong about why it's not working.
The text was updated successfully, but these errors were encountered:
Hmmh. That is tricky, since although Jackson's JAXB annotations module does (when registered) use JAXB annotations, this annotation has no real counterpart in Jackson world... so it will not have any effect.
Except that with addition of @JsonFormat, it could actually be taken to mean roughly same as:
@JsonFormat(shape=Shape.NUMBER)
which should then end up doing what you want, I think.
Could you file an issue for jackson-module-jaxb-annotations, with a link back to this issue? It should be relatively easy thing to add.
I have the following Java enum:
@XmlType
@XmlEnum(Integer.class)
public enum DefaultMessageVersion
{
@XmlEnumValue("1") ONE;
}
That is producing the following json schema snippet:
"defaultMessageVersion" : {
"type" : "string",
"enum" : [ "1" ]
}
This is because (I believe) Jackson ignores the @XmlEnum annotation. I would like the outputted snippet to have "type" : "integer" (or int? I'm not 100% sure which it is). I'm going to attempt to write the functionality myself, but would appreciate any pointers on where to get started, or a head-up if I'm just wrong about why it's not working.
The text was updated successfully, but these errors were encountered: