try
{
builder = new JsonBuilder(options.getPretty());
final SchemaToAvroJsonEncoder serializer = new SchemaToAvroJsonEncoder(builder, schema, fieldDefaultValueProvider, options);
serializer.encode(schema);
return builder.result();
}
catch (IOException exc)
{
throw new IllegalStateException(exc);
}