v14: Refactor and enhance System.Text.Json converters (#15960)

* Update JsonUdiConverter to support Udi, GuidUdi and StringUdi types

* Require boolean (like) value and rename to JsonFuzzyBooleanConverter

* Add read/write only JsonConverters and align naming

* Rename SystemTextJsonSerializer to DefaultJsonSerializer

* Rename SystemTextConfigurationEditorJsonSerializer to DefaultConfigurationEditorJsonSerializer

* Add JsonUdiRangeConverter

* Rename JsonFuzzyBooleanConverter back to JsonBooleanConverter

* Fix value type check in JsonObjectConverter

* Revert class names

* Updated tests

* Post fix after merge.

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Ronald Barendse
2024-04-10 20:21:24 +02:00
committed by GitHub
parent 1c5e27397b
commit 16dd5327d4
33 changed files with 495 additions and 332 deletions

View File

@@ -12,7 +12,7 @@ public class PropertyData
private string? _segment;
[DataMember(Order = 0)]
[JsonConverter(typeof(AutoInterningStringConverter))]
[JsonConverter(typeof(JsonStringInternConverter))]
[DefaultValue("")]
[JsonPropertyName("c")]
public string? Culture
@@ -24,7 +24,7 @@ public class PropertyData
}
[DataMember(Order = 1)]
[JsonConverter(typeof(AutoInterningStringConverter))]
[JsonConverter(typeof(JsonStringInternConverter))]
[DefaultValue("")]
[JsonPropertyName("s")]
public string? Segment