-
Notifications
You must be signed in to change notification settings - Fork 161
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
Implement protobuf codec for case class schemas #46
Conversation
JsonCodec.Encoder.charSequenceToByteChunk("""{"value":{"string":"foo"}}""") | ||
JsonCodec.Encoder.charSequenceToByteChunk("""{"oneOf":{"StringValue":{"value":"foo"}}}""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdegoes I'm not 100% sure about this but I think the encoding before was wrong w/r/t case classes with ADT fields. Not sure if the way it was implemented was just an optimization though....
} yield assert(e)(equalTo("0A03466F6F107B")) && assert(e2)(equalTo("0A03466F6F107B")) | ||
}, | ||
testM("enumerations") { | ||
for { | ||
e <- encode(schemaEnumeration, Enumeration(IntValue(482))).map(toHex) | ||
e2 <- encodeNS(schemaEnumeration, Enumeration(IntValue(482))).map(toHex) | ||
} yield assert(e)(equalTo("0A0310E203")) && assert(e2)(equalTo("0A0310E203")) | ||
} yield assert(e)(equalTo("0A05120308E203")) && assert(e2)(equalTo("0A05120308E203")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here as above.
@thinkharderdev Looks good to merge after the conflict is fixed! |
Thanks for your work on this! Protobuf continues to improve. |
* Implement protobuf codec for case class schemas * Add cases for all case class arities * resolve merge issue Co-authored-by: thinkharder <thinkharderdev@users.noreply.github.com>
No description provided.