-
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-rest-pipeline] Fix serialization of body of false #14218
Conversation
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.
Looks like this is ported from
if ((httpRequest.body !== undefined && httpRequest.body !== null) || required) { |
null
case too just to be safe?
Or is there a case that we actually want to use |
@jeremymeng I do not think |
Little bit worried about null bodies since its a valid JSON value. Supporting all JSON values in body seems like a good idea to me. |
@deyaaeldeen the union type has
|
@jeremymeng You are right, I missed it. Updated accordingly. |
@bterlson good point! I think it makes sense to revert 88abff3. @jeremymeng thoughts? |
I was looking at the truth table in |
What I meant is - if ((request.body !== undefined && request.body !== null) || required) {
+ if ((request.body !== undefined && request.body !== null) || (nullable && request.body === null) || required) { but it is an additional case to allow |
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 (
|
Adds a test case for a JSON body that is - false - null [according to the spec](https://www.json.org/json-en.html) Those tests were missed in #14218.
If the body contains just false, this check will confuse it with the body being non existent. This PR fixes this issue.
Adds a test case for a JSON body that is - false - null [according to the spec](https://www.json.org/json-en.html) Those tests were missed in Azure#14218.
add AVS 2021-06-01 API (Azure#14215) * add AVS 2021-06-01 API * add cmdlets custom word * rename ScriptCmdlet cmdletDescription to description (Azure#14218) * Adding optional to the script parameter (Azure#14437) Co-authored-by: David Becher <[email protected]> Co-authored-by: david becher <[email protected]> Co-authored-by: David Becher <[email protected]>
If the body contains just false, this check will confuse it with the body being non existent. This PR fixes this issue.