Fix jsonpropertynames#447
Merged
Merged
Conversation
added 2 commits
June 21, 2026 16:25
A Loadout journal event nests engineering modifiers under the JSON key
"Modifiers", which LoadoutEvent.EngineeringInfo maps to its Modifications
member via [JsonProperty("Modifiers")]. EventContractResolver overwrites
every property name with the C# member name, so it looks for
"Modifications" in the JSON, never finds it, and leaves Modifications null.
This test deserialises a real Loadout with an engineered FrameShiftDrive
and asserts the modifiers bind. It fails until the resolver honours
explicit [JsonProperty] names.
The resolver replaced every property name with the C# member name, which
discarded any [JsonProperty("...")] override and broke binding for renamed
members (Modifications -> "Modifiers", IsOn -> "On"). Now the member name
is only used as a fallback when no explicit JSON name is declared.
Fixes the failing engineered-module deserialisation test.
Owner
|
Hi Paul, thank you! The scope of this turned out to be way wider than just for the loadout event. There are a lot of fields annotated with a Life saver! |
Somfic
approved these changes
Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attempting to read a "loadout" event shows all modules as blank, even though they show in the source journal entry.
This looks like a slight oversight in the custom ContractResolver