// Most of the configuration now handled through EndpointConfig, ObjectWriter
// but we may need to force root type:
if (rootType != null) {
writer = writer.withType(rootType);
}
value = endpoint.modifyBeforeWrite(value);
writer.writeValue(jg, value);
} finally {
jg.close();
}
}