AdrianStrugala / AvroConvert

Rapid Avro serializer for C# .NET
Other
97 stars 27 forks source link

Added an UUID Schema parser to the DefaultValueResolver #128

Closed AlexFera closed 8 months ago

AlexFera commented 8 months ago

I was having an issue with generating JSON from AVRO. I managed to track down the issue to having a default value for an UUID.

E.g. for this schema:

{
   "type": "record",
   "name": "RecordName",
   "namespace": "com.example",
   "fields": [
      {
         "name": "some-id",
         "type": {
            "type": "string",
            "logicalType": "uuid"
         },
         "default": "00000000-0000-0000-0000-000000000000"
      }
   ]
}

I'm not familiar with the project, but I have a proposal for a fix in this PR, which consists of including the UuidSchema parser in the DefaultValueResolver.

Please let me know if I'm on the right track, and if you have any other suggestions.

AdrianStrugala commented 8 months ago

That's a very good PR, thank you for your contribution! Just a single small comment from my side and it's good to go

AlexFera commented 8 months ago

That's a very good PR, thank you for your contribution! Just a single small comment from my side and it's good to go

Thank you! I have resolved the comment. Glad I could help!

AdrianStrugala commented 8 months ago

Thanks, I will create the next release tomorrow or early next week