-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat(NewtonsoftJson): Upconvert from Case that should be a string #97
Comments
What's the use-case? Someone might have persisted this to their DB without checking what it actually serializes as? |
Exactly - DUs in particular are notorious; the standard encoding is sensitive to reordering of fields etc, and more, as mentioned in the linked json.net issue. The most common thing IME is that people use random SCDUs and typesafe enums declared in common files in serialised structs. And then, once it's in the database, you're tied to that representation forever unless you're prepared to roundtrip e.g. all the events in your event store to 'fix' them, and life is short! |
Poor man's impl:
|
Provide an upconversion that lets you write the updated form per
TypeSafeEnumConverter
, but also accept mangled versions that predate impl of #96i.e. read:
but write:
related: JamesNK/Newtonsoft.Json#1662 (comment)
The text was updated successfully, but these errors were encountered: