You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we change A to be optional, then our serialization logic doesn't check if both A and B are null, before writing value of properties. We should skip properties if both A and B are null.
If we change A to be optional, how do we enforce it must be set if any other property on the same level is set? Like, a customer sets foo.B = 12, but leaves foo.A to be null.
a. Check A during serialization, which will surprise users since A is int?.
b. Don't check, wait for the server side to return error, which will still surprise users.
If we choose to maintain the original optionality, then how do we give users a way to unset properties?
The text was updated successfully, but these errors were encountered:
Problem
This is derived from comment here. Consider the following scenario of property flattening.
In M4, both
Bar.a
andBar.b
will be flattened intoFoo
and will all be optional. That is, the expected CSharp model codes should be like.However, that will have a few problems.
A
to be optional, then our serialization logic doesn't check if bothA
andB
are null, before writing value ofproperties
. We should skipproperties
if bothA
andB
are null.A
to be optional, how do we enforce it must be set if any other property on the same level is set? Like, a customer setsfoo.B = 12
, but leavesfoo.A
to be null.a. Check
A
during serialization, which will surprise users sinceA
isint?
.b. Don't check, wait for the server side to return error, which will still surprise users.
properties
?The text was updated successfully, but these errors were encountered: