Query Parameters Serialization - Explode doesn't respect the default value#544
Query Parameters Serialization - Explode doesn't respect the default value#544darrelmiller merged 2 commits intomicrosoft:vnextmicrosoft/OpenAPI.NET:vnextfrom simon-pearson:feature/explode-default-valuesimon-pearson/OpenAPI.NET:feature/explode-default-valueCopy head branch name to clipboard
Conversation
…ault value for the explode property should be true. For all other styles the default value is false. Cover this in a unit test.
|
I understand this fix but the serialization code looks wrong:
Maybe it should be:
Then the serialized model would reflect the actual values read in (as _explode is a nullable bool?). Also, there is now an inconsistency as Style is also not set to a default value: |
|
@safepage The serialization code will write out any value that was read because that is what the Explode property does by default (unless it is the default value). Only if Explode has not be set, i.e. _explode is null will the default value be used. If the Explode property returns a "default" then it will match with the default passed as the third parameter to WriteProperty and no Explode value will be written to the output. This does mean that if a input document redundantly provides the default value, then it will be missing in the output. |
Uh oh!
There was an error while loading. Please reload this page.