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

Revert to using Newtonsoft.Json for parsing instance #910

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

ivarne
Copy link
Member

@ivarne ivarne commented Nov 18, 2024

There was reported inconsistent behaviour when deserializing enums, which would likely be fixed if we add System.Text.Json annotations to Storage.Interfaces

The change was introduced in #853, so it makes sense to revert.
6bac8a1#diff-509e2ea0fedd1d6a1d2d1c84b39ad128f078c03b225ce39ef5b578614beccbadL1224-R1233

Related Issue(s)

  • reported privately by @chrrust on slack

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)

There was reported inconsistent behaviour when deserializing enums, which would likely be fixed if we add System.Text.Json annotations to Storage.Interfaces
@ivarne ivarne requested a review from martinothamar November 18, 2024 20:43
@ivarne ivarne added the bugfix Label Pull requests with bugfix. Used when generation releasenotes label Nov 18, 2024
Copy link
Contributor

@martinothamar martinothamar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like @HauklandJ to review here. Do we use string serialization of enums in our API? (as in IOptionsMonitor<JsonOptions>.Get(JsonSettingNames.AltinnApi)), or was it the other way around

@HauklandJ
Copy link
Contributor

Would like @HauklandJ to review here. Do we use string serialization of enums in our API? (as in IOptionsMonitor<JsonOptions>.Get(JsonSettingNames.AltinnApi)), or was it the other way around

We use number serlialization of enums.

@ivarne
Copy link
Member Author

ivarne commented Nov 19, 2024

We use number serlialization of enums.

That is not entirely correct, because in lots of places we use [JsonConverter(typeof(JsonStringEnumConverter))]. In this case this PR preserves the behaviour from v8.3.x and earlier, so I think this should be merged before releasing v8.5

@ivarne ivarne merged commit df68f8c into main Nov 19, 2024
11 of 12 checks passed
@ivarne ivarne deleted the bug/revert-to-newtonsoft-for-instance-parsing branch November 19, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Label Pull requests with bugfix. Used when generation releasenotes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants