SchemaBuilder.PropBuilder - setting JsonNode values

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

SchemaBuilder.PropBuilder - setting JsonNode values

Jeffrey Mullins (BLOOMBERG/ BOSTON)
When programmatically building schemas, SchemaBuilder.PropBuilder#prop() only publicly permits adding string property values.

In classes like FieldBuilder, this limits the ability to programmatically create schemas with non-string property values -- which can be created when directly parsing a schema. 

In our case, we'd like the ability to programmatically add non-string extension property values for types like booleans. Since we augment and normalize developer-provided Avro schemas, the absence of this puts us in a difficult position where we cannot programmatically reproduce valid Avro schemas with non-string property values.

PropBuilder does contain a non-public method for adding JsonValue properties. This is what we're looking for in FieldBuilder and this may be applicable to other builders as well.  

If this change is desirable on some or all builders we're happy to submit a Jira along with a patch for review.

Thank you,
Jeff

Sent from Bloomberg Professional for iPhone