@Override
    public ObjectNode generateSchema() {
        SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2020_12, OptionPreset.PLAIN_JSON);
        configBuilder.with(new JakartaValidationModule());
        configBuilder.forFields()
                .withTargetTypeOverridesResolver(this::treatByteArrayAsString)
                .withInstanceAttributeOverride(this::addContentEncodingForByteArray);
        SchemaGeneratorConfig config = configBuilder.build();
        SchemaGenerator generator = new SchemaGenerator(config);
        return generator.generateSchema(Example.class);
    }
Example created in response to <a href="https://github.com/victools/jsonschema-generator/discussions/451">#451</a>.
<br/>
Demonstrating target type overrides to represent a {@code byte[]} as {@code string} with particular content encoding.
jsonschema-examples/src/main/java/com/github/victools/jsonschema/examples/TargetTypeOverrideExample.java