Skip to content
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

Fix and add tests for non-record payloads #103

Closed
bartelink opened this issue Mar 1, 2019 · 1 comment
Closed

Fix and add tests for non-record payloads #103

bartelink opened this issue Mar 1, 2019 · 1 comment
Milestone

Comments

@bartelink
Copy link
Collaborator

Atm unions with string payloads don't correctly roundtrip in Equinox.Cosmos with the UnionEncoder.

Also need to validate round-tripping of tupled union cases and/or whether it's sensitive to the order of the [named] elements in the tuple (as https://github.com/jet/jet.jsonnet.converters isnt)

cc @jakzale

@bartelink
Copy link
Collaborator Author

@jakzale Root issue was some placeholder code was stubbing out the serialization of all but records (TypeShape's UnionEncoder only added support for non-record Event Payloads in v5 so it was a non-issue at that point).

I've disabled the support for this based on:

  • primitive types make a very bad payload for an event as they can't be extended easily or cleanly (people will do some very ugly String.Split stuff!)
  • getting dates and strings to work correctly is non-trivial for a variety of reasons, not least the idiosyncratic decision making that Newtonsoft.Json brings

The tests are in place to enable adding clean support for this in the course of addressing #79 should it prove viable to do easily (but note the lack of extensibility all for a very minor saving in terms of typing and/or storage bytes).

@bartelink bartelink added this to the 2.0 milestone Apr 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant