-
Notifications
You must be signed in to change notification settings - Fork 45
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
Implemented ability to deserialize discriminated unions regardless of union tag position #95
Conversation
… union tag position
Unfortunately, I was not managed to design changes that would allow doing |
@Tarmil could you have a look? |
I've been pretty busy this week but I'll take a look this weekend. |
This looks pretty good! I was unsure whether saving and restoring a I added some tests, and fixed an issue in the AdjacentTag case. I'll definitely add a flag to determine whether to use it or not, because despite the low allocation we're still re-parsing the object, and some people may want to ensure they don't do that. But I think I'll make it enabled by default. |
Cool! Thanks! |
@Tarmil is there something left preventing this to be merged? |
Just my schedule 🙂 I'll add the flag and release it now. |
I create a snapshot of a reader (a copy of structure) and parse it into a
JsonDocument
(which is a lazy operation) and do a union case lookup.I have not added new tests but played with modification of existing (not committed) so add tests as appropriate.
Fixes #93