-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decode avro message to standard JSON #247
Comments
I've got some code for this in testing. I'll still wait a bit to see if @karrick or anybody can think of any hazards. I've done it in the safest way so it will probably be good. I made a new New* function for two-way json usage. The old one will still do exactly what it did before. Folks who want to go two-ways will be able to use the new New* function. I think this approach should be perfectly safe aside from bugs. I've got a full suite of tests on it already. |
Can you go have a look at pr #249. It needs some reviewers. |
I think we close this one now. I just merged the two-way json PR #249, and it is expected to provide the functionality you are describing. |
Works as expected! Thank you @xmcqueen |
This apparent double encoding encapsulation is required for union type support, and it was done in accordance with the Avro specification. The Avro specification requires values of union types to be represented as a JSON object, which itself declares which of the various union types this particular datum is. Removing this extra annoying element will break ability of clients to encode or decode schemas with union types. |
Hello,
I recently found out, that it is now possible to use standard JSON as input to goavro 👍
As far as I can tell, that currently does not work the other way around, meaning when I decode an avro message with the same codec it does not generate standard JSON:
This currently prints
{"myField":{"string":"testValue"}}
, but I expected it to be{"myField":"testValue"}
.Am I missing something?
Is the decoding not implemented, yet?
Are there plans to do so?
Thanks
The text was updated successfully, but these errors were encountered: