Closed sabbysabs closed 2 months ago
Hi @sabbysabs. avsc
doesn't expose an option to auto-convert types to their string representation. You could achieve it with the combination of a logical type to do the transformation and a type hook to apply it where it makes sense, but I would not recommend it as first option. If possible, it would be better to update the schema to reflect the true types, or explicitly convert the fields that need it.
I have a JSON structure coming in and it has string representations of Booleans, Ints, Longs. I believe that avsc has the capability to infer if given the right options on the parse function. However, I'm not entirely sure how to go about doing this and would greatly appreciate any assistance.
My sample JSON: input.json
My Schema: runscope.json
My code:
The error message I get is this: