-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
API review for JsonExtensionDataAttribute #29495
Comments
Looks right to me 👍 |
Extension data looks like a simple feature on the surface, but there are a lot of interactions with other features you need to think about. For example, if you configure a serializer to throw an error when there is a JSON property that doesn't match a property on the .NET class, but the .NET class has an extension data property, what should happen? Or during serialization, what should happen to property keys when a camel case name policy is set? Are keys processed or not. I will come up with a list of questions to resolve |
|
Should there be flags on extension data attribute to opt-out of one side of round-tripping data, e.g. https://github.com/JamesNK/Newtonsoft.Json/blob/4ab34b0461fb595805d092a46a58f35f66c84d6a/Src/Newtonsoft.Json/JsonExtensionDataAttribute.cs |
Should note in documentation that extension data will be serialized, even if a property of the same name exists - JamesNK/Newtonsoft.Json#1017 |
Thanks @JamesNK. Open issues to discuss:
Currently throwing is not supported, so we will need to track this until we add that feature.
Current they are left as-is. I don't think we want to always use the
Currently no. Just public properties like existing data.
Currently
If not the two supported dictionaries, we throw an
Currently "yes" for both which is consistent with Json.NET.
Currently we throw |
This is what I was thinking 👍
Hmm, yeah I guess you could do that. I have never had someone ask for Read/Write on JsonIgnore. No matter how it is done, I don't think this is an urgent feature.
Requiring extension data to be on a public is fine for now. Support on private could always be added in the future.
👍
👍
👍 |
Leaving this issue open while we discuss |
Closing. No planned support in this release for:
|
Re-open for API review. |
Closing as API approved. |
Identifies overflow \ extension data attribute to hold JSON values when there is no matching properties, and be able to serialize them to enable round-tripping.
Note the name matches Json.Net's equivalent attribute.
The text was updated successfully, but these errors were encountered: