FasterXML / FasterXML/jackson-module-jsonSchema

Using @XmlEnum to generate an enum of type Integer in json schema

Ouverte
#49 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
387
Forks
136
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.