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

#322 Deserializing applicationmetadata keeps unmapped properties #323

Merged
merged 4 commits into from
Oct 17, 2023

Conversation

tjololo
Copy link
Member

@tjololo tjololo commented Oct 13, 2023

Description

Fixes #322

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@ivarne
Copy link
Member

ivarne commented Oct 13, 2023

If we need to support newtonsoft json, there should probably be a test for it.

Also, the important thing to test here is the round trip deserialization - serialization. I don’t think we actually care much about accessing unknown properties through the dictionary.

@tjololo
Copy link
Member Author

tjololo commented Oct 13, 2023

If we need to support newtonsoft json, there should probably be a test for it.

Also, the important thing to test here is the round trip deserialization - serialization. I don’t think we actually care much about accessing unknown properties through the dictionary.

While trying to create tests for newtonsoft I realised that supporting newtonsoft would result in a different json returned if serializing with system.text and deserializing with newtonsoft (JsonElement vs JToken) as we still plan to remove Newtonsoft in favor of System.Text I don't think it is worth the effort to support both when we are using System.Text.Json to deserialize the file in AppMetadata.cs

This is to ensure that the returned json actually includes the extra fields
@sonarcloud
Copy link

sonarcloud bot commented Oct 13, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@tjololo tjololo merged commit a32abbf into v8 Oct 17, 2023
10 checks passed
@tjololo tjololo deleted the v8-feature/support-unmapped-appmetadata branch October 17, 2023 06:18
@tjololo tjololo added the feature Label Pull requests with new features. Used when generation releasenotes label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Label Pull requests with new features. Used when generation releasenotes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants