-
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
[Core v2] Return null when the response is empty and nullable #14366
Conversation
/azp js run ai-text-analytics tests |
Command 'js' is not supported by Azure Pipelines. Supported commands
See additional documentation. |
/azp run js ai-text-analytics tests |
No pipelines are associated with this pull request. |
/azp run js - ai-text-analytics tests |
No pipelines are associated with this pull request. |
/azp run js - ai-text-analytics - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run js - eventgrid - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run js - data-tables - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Co-authored-by: Jeremy Meng <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking much cleaner! A few last remarks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to see this utility function looking cleaner! 🥳
Hello @deyaaeldeen! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Updates the changelog with the work done in #14366 and renames `isPrimitiveType` to `isPrimitiveBody`. EDIT: I also refactored `flattenResponse` further so it now has just one call to `handleNullableResponseAndWrappableBody`.
…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.
Updates the changelog with the work done in Azure#14366 and renames `isPrimitiveType` to `isPrimitiveBody`. EDIT: I also refactored `flattenResponse` further so it now has just one call to `handleNullableResponseAndWrappableBody`.
Fixes #12009.
Scenario
When the service does not return a body (Example in our test server).
Expectation
Response will be
null
if the mapper says it isnullable
.Current State
Response is an empty object or array (Example).
Fix
Implements the expectation by doing case analysis and adds test cases.