FasterXML / FasterXML/jackson-module-jsonSchema

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

Aberta
#49 2 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Java
Estrelas
387
Forks
136
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.