Skip to content

Conversation

@Karan-Palan
Copy link
Contributor

What kind of change does this PR introduce?

Bugfix: Ensures brackets inside strings are ignored during parsing in the getPartsOfArrayContent function.

Issue Number:

Screenshots/videos:
N/A

If relevant, did you update the documentation?

No updates required as this is a bugfix to existing functionality.

Summary

This pull request addresses a parsing error in the getPartsOfArrayContent function in lib/getPartsOfJson.ts. The function previously failed to ignore brackets ({, }, [, ]) that appear inside strings, leading to incorrect parsing of JSON arrays.

Before:
Example Input:

[
  "{key:value}",
  "[nested]",
  "\"A String with {brackets}\"",
  "true",
  143,
  null
]

After:
The function now correctly parses the array values and ignores brackets inside strings.

Does this PR introduce a breaking change?
No breaking changes.

@Karan-Palan Karan-Palan requested a review from a team as a code owner January 9, 2025 16:45
@github-actions
Copy link

github-actions bot commented Jan 9, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview b7c96a0

@codecov
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (72ae168) to head (b7c96a0).
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1268   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          373       373           
  Branches        94        94           
=========================================
  Hits           373       373           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@DhairyaMajmudar DhairyaMajmudar left a comment

Choose a reason for hiding this comment

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

Awsm work here @Karan-Palan, LGTM 👍🏻

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

LGTM

@benjagm benjagm merged commit 8b4b3eb into json-schema-org:main Jan 18, 2025
11 checks passed
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.

🐛 Bug: Incorrect Bracket Filtering in Strings within getPartsOfArrayContent

3 participants