Skip to content

allow null in jsonBody #326

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

Open
wants to merge 1 commit into
base: v4.x
Choose a base branch
from
Open

allow null in jsonBody #326

wants to merge 1 commit into from

Conversation

chaoky
Copy link

@chaoky chaoky commented Jan 13, 2025

with this change a { jsonBody: null } will be serialized as JSON, in pair with how JSON.stringfy works
#325

@chaoky chaoky requested a review from a team as a code owner January 13, 2025 21:37
@chaoky
Copy link
Author

chaoky commented Jan 13, 2025

/azp run

Copy link

Commenter does not have sufficient privileges for PR 326 in repo Azure/azure-functions-nodejs-library

@hallvictoria
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -27,7 +27,7 @@ export class HttpResponse implements types.HttpResponse {
this.#uRes = init.undiciResponse;
} else {
const uResInit: uResponseInit = { status: init.status, headers: init.headers };
if (isDefined(init.jsonBody)) {
if (init.jsonBody !== undefined) {
this.#uRes = uResponse.json(init.jsonBody, uResInit);
Copy link

@swapnil-nagar swapnil-nagar Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have tests, covering these change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants