Skip to content
Discussion options

You must be logged in to vote

Hi @EdwardJunyan,

If you want special handling for a given type, a CustomDefinitionProvider is the way to go.
The below assumes that the NumberEnum is not private but visible from where the schema generator configuration is defined:

configBuilder.forTypesInGeneral().withCustomDefinitionProvider((javaType, context) -> {
    if (!javaType.isInstanceOf(Test.NumberEnum.class)) {
        return null;
    }
    ObjectNode customNode = context.getGeneratorConfig().createObjectNode()
            .put(context.getKeyword(SchemaKeyword.TAG_TYPE), context.getKeyword(SchemaKeyword.TAG_TYPE_NUMBER));
    AttributeCollector collector = new AttributeCollector(context.getGeneratorConfig().getObjectMapper(…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@EdwardJunyan
Comment options

Answer selected by EdwardJunyan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants