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

JsonIgnore Needs to be Added wherever XmlIgnore is #5005

Closed
mtrutledge opened this issue Feb 4, 2022 · 3 comments
Closed

JsonIgnore Needs to be Added wherever XmlIgnore is #5005

mtrutledge opened this issue Feb 4, 2022 · 3 comments

Comments

@mtrutledge
Copy link
Contributor

Description of problem

I am currently working on updating the Redis Cache Provider to support JSON serialization with a binary fall back. A common error I am currently seeing is:

Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property 'Vocabulary' with type 'DotNetNuke.Entities.Content.Taxonomy.Vocabulary'. Path '$values[0].DesktopModule.Terms.$values[0].Vocabulary.Terms.$values[0]'.

Looking at the file DNN Platform/Library/Entities/Content/Taxonomy/Term.cs I see that in order to avoid this issue on the XML side, XmlIgnore was added to multiple properties. In order to support Json Serialization we will need to add JsonIgnore to the attributes that have XmlIgnore

Description of solution

In order to support Json Serialization we will need to add JsonIgnore to the attributes that have XmlIgnore

@mtrutledge
Copy link
Contributor Author

I can work on this one

@mtrutledge
Copy link
Contributor Author

Are there any preferences on how I do this? I can do just the Terms.cs class now. Or I can search for [XmlIgnore] and add [JsonIgnore] as well. I just don't want to create a PR that has 100's of file changes. Let me know.

@mitchelsellers
Copy link
Contributor

@mtrutledge My preference for this would be lets go for the full solution in a single PR, targeting the 9.11.0 release branch. Improving the serialization ability of core objects is a positive change for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants