Skip to content

Commit

Permalink
Rename the resolver.
Browse files Browse the repository at this point in the history
And mark that this resolver is referenced by https://stackoverflow.com/a/18548894.
  • Loading branch information
andy840119 committed Aug 21, 2022
1 parent 38bde40 commit 94c69aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public sealed override void WriteJson(JsonWriter writer, TType? value, JsonSeria
// follow: https://stackoverflow.com/a/59329703
// not a good way but seems there's no better choice.
serializer.Converters.Remove(this);
serializer.ContractResolver = new KaraokeSkinContractResolver();
serializer.ContractResolver = new WritablePropertiesOnlyResolver();

var jObject = JObject.FromObject(value, serializer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Karaoke.IO.Serialization
/// <summary>
/// This contract resolver is for save and load data from <see cref="KaraokeSkin"/>
/// </summary>
public class KaraokeSkinContractResolver : SnakeCaseKeyContractResolver
public class WritablePropertiesOnlyResolver : SnakeCaseKeyContractResolver
{
// we only wants to save properties that only writable.
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
Expand Down

0 comments on commit 94c69aa

Please sign in to comment.