-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deserialize null faithfully #12009
Comments
So, the "null" response would not have a corresponding |
@HarshaNalluru |
consider for #8535 |
|
Fixes #12009. # Scenario When the service does not return a body ([Example in our test server](https://github.com/Azure/autorest.testserver/blob/4b994be5fd68b3ac009af30399ad6b817630dbc8/legacy/routes/dictionary.js#L24)). # Expectation Response will be `null` if the mapper says it is `nullable`. # Current State Response is an empty object or array ([Example](https://github.com/Azure/autorest.typescript/blob/c8e68b845ccc3780d8c4be3787eb2c5e74272697/test/integration/bodyArray.spec.ts#L21)). # Fix Implements the expectation by doing case analysis and adds test cases.
…14366) Fixes Azure#12009. # Scenario When the service does not return a body ([Example in our test server](https://github.com/Azure/autorest.testserver/blob/4b994be5fd68b3ac009af30399ad6b817630dbc8/legacy/routes/dictionary.js#L24)). # Expectation Response will be `null` if the mapper says it is `nullable`. # Current State Response is an empty object or array ([Example](https://github.com/Azure/autorest.typescript/blob/c8e68b845ccc3780d8c4be3787eb2c5e74272697/test/integration/bodyArray.spec.ts#L21)). # Fix Implements the expectation by doing case analysis and adds test cases.
Currently
core-http
deserialize empty body response with a default value and not a null (here is an example). The reason we do not deserialize tonull
is we always attach a_response
information to our response values and this is not possible with anull
. In order to faithfully deserialize values coming form the server, we need to change the representation of_response
. This should be taken into consideration in this issue: #10887. Because it is a breaking change, it should be planned forcore-http v2
.The text was updated successfully, but these errors were encountered: