Skip to content
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

fix: format falsy constants properly in json formatter #1792

Merged
merged 2 commits into from Jul 8, 2021
Merged

fix: format falsy constants properly in json formatter #1792

merged 2 commits into from Jul 8, 2021

Conversation

ziacik
Copy link
Contributor

@ziacik ziacik commented Jun 22, 2019

Pre-Submission Checklist

  • Opened an issue discussing these changes before opening the PR
  • Ran the linter and tests via make prepush
  • Included comprehensive and convincing tests for changes

Issues

Closes:

Changes

Json formatter now formats 0 as 0, false as false, empty string as "", undefined, null and NaN as null. Note that although the formatter formats undefined as null to generate valid JSON constant, res.send(200, undefined) flushes empty response before the formatter gets into action.

@robpaveza
Copy link

This is a good update; I'd like to see it merged. (I'd vote +1 but I don't have write access anyway).

@retrohacker
Copy link
Member

Thanks for the contribution @ziacik and for the review @robpaveza!

@retrohacker
Copy link
Member

Will merge this if we can resolve the merge conflicts.

@ghermeto
Copy link
Member

ghermeto commented Apr 7, 2021

@ziacik if you can resolve the conflicts we can merge this PR.

@ziacik
Copy link
Contributor Author

ziacik commented Apr 10, 2021

@ghermeto Conflict resolved

@ziacik
Copy link
Contributor Author

ziacik commented Jul 8, 2021

@ghermeto @retrohacker Is there anything else you need me to do?

@ghermeto ghermeto merged commit 3002182 into restify:master Jul 8, 2021
@ghermeto
Copy link
Member

ghermeto commented Jul 8, 2021

sorry, I missed the notification

@ghermeto
Copy link
Member

ghermeto commented Jul 8, 2021

IMO this is technically a breaking change, so we will target 9.X

@ziacik ziacik deleted the fix/res-send-falsy-json branch July 9, 2021 14:56
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.

None yet

4 participants