Currently if one were to register a converter with options like so:

JsonGenerator.Options options = new JsonGenerator.Options()
options.addConverter(MyCustomType) { MyCustomType mct ->
    mct.name
}
    

Assuming “mct.name” returns a string, it will be output without quotes because 
of:

Converter converter = findConverter(objectClass);
if (converter != null) {
    writeRaw(converter.convert(object, key), buffer);
    return;
}

I’d be curious to hear what the use case is for outputting the data as raw. I 
think the percentage of users that would prefer to have their data further 
processed by that method would vastly outnumber the ones that do not.

I think something like this would be a better solution:

Converter converter = findConverter(objectClass);
if (converter != null) {
    object = converter.convert(object, key);
}

Thoughts?

Thanks,
James Kleeh

Reply via email to