I was able to get something working locally that supports this kind of feature
while staying true to the fluent-style of the SchemaBuilder. A snippet from a
test I wrote to see what it looks like:
SchemaBuilder.record("ValidationRecord")
.fields()
.name("IntegerField")
.notValidatingDefaults()
.type("int")
.withDefault(“foo”)
.endRecord();
Thoughts? If this is something we’d like to support, I can open a pull request
for review.
Best,
Andreas | www.andreashailu.com <http://www.andreashailu.com/>
> On Jun 1, 2021, at 11:12 AM, Andreas Hailu <[email protected]> wrote:
>
> Fixed a typo inline in the previous message - apologies.
>
>
>> On Jun 1, 2021, at 11:07 AM, Andreas Hailu <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>> Hello,
>> The SchemaBuilder's createFields methods pass a value of 'true' to the
>> validateDefault option within the Field constructor. While this is very
>> useful to have, it results in not being able to seamlessly migrate from 1.8
>> to >= 1.9 if an application/schema registry already has schemata with
>> invalid defaults.
>>
>> Given that Schema.Parser allows us to configure this, what are your thoughts
>> on supporting the same idea within SchemaBuilder? I created a JIRA [1] with
>> some details and would be happy to contribute if we’d like to support this.
>>
>> [1] https://issues.apache.org/jira/browse/AVRO-3144
>> <https://issues.apache.org/jira/browse/AVRO-3144>
>>
>> Best,
>> Andreas | www.andreashailu.com <http://www.andreashailu.com/>
>>
>>
>>
>>
>