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: json body prettify not working with comments #1831

Merged
merged 2 commits into from Apr 9, 2024

Conversation

asonkeri
Copy link
Contributor

Added Microsoft's node-jsonc-parser library that is able to format json with comments. Seems to handle bigints properly too.

It may be good to consider replacing existing decomment library with jsonc-parser if its only use case is to decomment json.

Fixes #1830

Before. Failing to prettify JSON body with comments:
image

After. JSON body properly formatted:
image

Description

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Added Microsoft's node-jsonc-parser library that is able to format json
with comments. Seems to handle bigints properly too.

It may be good to consider replacing existing `decomment` library with
`jsonc-parser` if its only use case is to decomment json.

Fixes usebruno#1830
@helloanoop helloanoop merged commit 00c0e41 into usebruno:main Apr 9, 2024
3 checks passed
@helloanoop
Copy link
Contributor

Merged!

Thank you @asonkeri !

slowjoe007 pushed a commit to slowjoe007/bruno that referenced this pull request Apr 10, 2024
Added Microsoft's node-jsonc-parser library that is able to format json
with comments. Seems to handle bigints properly too.

It may be good to consider replacing existing `decomment` library with
`jsonc-parser` if its only use case is to decomment json.

Fixes usebruno#1830

Co-authored-by: Anoop M D <anoop.md1421@gmail.com>
Its-treason pushed a commit to Its-treason/bruno that referenced this pull request Apr 13, 2024
Added Microsoft's node-jsonc-parser library that is able to format json
with comments. Seems to handle bigints properly too.

It may be good to consider replacing existing `decomment` library with
`jsonc-parser` if its only use case is to decomment json.

Fixes usebruno#1830

Co-authored-by: Anoop M D <anoop.md1421@gmail.com>
lizziemac pushed a commit to lizziemac/bruno that referenced this pull request May 4, 2024
Added Microsoft's node-jsonc-parser library that is able to format json
with comments. Seems to handle bigints properly too.

It may be good to consider replacing existing `decomment` library with
`jsonc-parser` if its only use case is to decomment json.

Fixes usebruno#1830

Co-authored-by: Anoop M D <anoop.md1421@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Prettify not working if JSON body contains comments
3 participants