Skip to content
This repository was archived by the owner on Jan 22, 2019. It is now read-only.

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

@jesse8888

Description

@jesse8888

I just posted an issue in jackson-module-jsonSchema.

FasterXML/jackson-module-jsonSchema#49

For completeness:

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 have posted the issue here at the request of cowtowncoder, and am hoping that I can submit a fix myself (with pointers on where to look), or that someone else with more knowledge and expertise can take care of it without too much trouble.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions