-
Notifications
You must be signed in to change notification settings - Fork 10
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
Cannot serialize back results to JSON with System.Text.Json #28
Comments
Ah you mean you are serializing a Yes, I'll have a look - it's certainly not intentional to prevent doing your own (de)serialization. |
Yes that's it. Sorry for being a bit vague... Thanks a lot! |
Otherwise, user (de)serialization of `PartialDate` objects will use our reader, effectively preventing serialization. No other changes should be needed; `PartialDate` is a not a top-level type in the MB API, so its reader is used directly by the readers for containing types. Fixes #28.
Can you try with the CI build from https://ci.appveyor.com/nuget/metabrainz-musicbrainz-d79tac5nmfsx (you'll want 4.0.0-pre.appveyor.80)? |
I think the feed need authentication, here's why I see:
|
Nevermind the feed is working ok! I just tried and the last build do fix my issue :) Thanks a lot! Have a nice day. |
Not closing this until it's fixed in an actual release. I'll want to validate the PR build some more before merging it, and I won't be releasing until I've removed the use of |
Great I'll be notified when this issue is closed and will switch back to the official Nuget feed then. Good luck for the switch to HttpClient ;). |
Well, when the issue is closed you can start taking builds from that feed other than specifically 4.0.0-pre.appveyor.80 (but even then, not all builds on that feed will be from the main branch). You can only switch to main NuGet once a release is cut (if you star the repo, I think GitHub will notify you of releases). |
Otherwise, user (de)serialization of `PartialDate` objects will use our reader, effectively preventing serialization. No other changes should be needed; `PartialDate` is a not a top-level type in the MB API, so its reader is used directly by the readers for containing types. Fixes #28.
Hi,
When I try to serialize results to JSON, I get this error:
The problems seems to come from the JsonConverter attribute here: https://github.com/Zastai/MetaBrainz.MusicBrainz/blob/main/MetaBrainz.MusicBrainz/PartialDate.cs#L14
If you could move it to https://github.com/Zastai/MetaBrainz.MusicBrainz/blob/main/MetaBrainz.MusicBrainz/Json/Converters.cs
I think that would solve the issue.
Thanks for this library btw :)
The text was updated successfully, but these errors were encountered: