@Override
    public void applyToConfigBuilder(SchemaGeneratorConfigBuilder builder) {
        if (this.enumConstantToString == null) {
            // ignore all direct enum methods but name() - methods declared by a specific enum subtype are not ignored
            builder.forMethods()
                    .withIgnoreCheck(method -> EnumModule.isEnum(method.getDeclaringType()) && !"name".equals(method.getName()))
                    .withNullableCheck(method -> EnumModule.isEnum(method.getDeclaringType()) ? Boolean.FALSE : null)
                    .withEnumResolver(EnumModule::extractEnumValues);
            builder.forFields()
                    .withIgnoreCheck(field -> field.getRawMember().isEnumConstant());
        } else {
            builder.forTypesInGeneral().withCustomDefinitionProvider(new EnumAsStringDefinitionProvider(this.enumConstantToString));
        }
    }
Constructor remembering whether to treat enums as plain strings or as objects.

@param enumConstantToString how to derive a plain string representation from an enum constant value, may be null to treat them as objects
jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/module/EnumModule.java