Support round-trip CRD (de)serialization (#1034)

* Support round-trip CRD (de)serialization

* Add a floating point emitter to fix UT

* Unused using

* Stylecop

* Reduce warnings
This commit is contained in:
stan-sz
2022-09-27 10:01:51 +02:00
committed by GitHub
parent dec73d412a
commit bbd3b6cd50
4 changed files with 85 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ namespace k8s
.WithTypeConverter(new IntOrStringYamlConverter())
.WithTypeConverter(new ByteArrayStringYamlConverter())
.WithTypeConverter(new ResourceQuantityYamlConverter())
.WithAttemptingUnquotedStringTypeDeserialization()
.WithOverridesFromJsonPropertyAttributes()
.IgnoreUnmatchedProperties()
.Build();
@@ -33,6 +34,7 @@ namespace k8s
.WithTypeConverter(new ByteArrayStringYamlConverter())
.WithTypeConverter(new ResourceQuantityYamlConverter())
.WithEventEmitter(e => new StringQuotingEmitter(e))
.WithEventEmitter(e => new FloatEmitter(e))
.ConfigureDefaultValuesHandling(DefaultValuesHandling.OmitNull)
.WithOverridesFromJsonPropertyAttributes()
.BuildValueSerializer();