[Bug][Serialization][AdditionalProperties Phase 1] Exception will be thrown when the model accepts AdditionalProperties with a value type of non-BinaryData #4128
Labels
DPG/RLC v2.1
Post Gallium work
DPG
Mgmt
This issue is related to a management-plane library.
v3
Version 3 of AutoRest C# generator.
when a model defined with
string
typed additional properties property, we have the following deserialization code:if we use this json:
as input to deserialize the model, we will get a
JsonException
on this line:when we try to consume "addtional2" property in the json (because it is a number).
Furthermore, the public serialization feature requires the models to be roundtrip when serializing and deserializing using the
J
format, in this case, it will never be roundtrip because no property or field could take the number value additional propertyadditional2
.The text was updated successfully, but these errors were encountered: