Skip to content

Fix leading comma in JSON export#1349

Merged
lippserd merged 1 commit intomainfrom
fix/json-export
Mar 25, 2026
Merged

Fix leading comma in JSON export#1349
lippserd merged 1 commit intomainfrom
fix/json-export

Conversation

@sukhwinder33445
Copy link
Copy Markdown
Contributor

@sukhwinder33445 sukhwinder33445 commented Mar 19, 2026

When exporting JSON with a limit and a page > 1 set, a leading comma is added before the first item because ($offset !== 0) evaluates to true, resulting in invalid JSON.

Replace the offset-based condition with a $first flag to track whether any item has been written yet.

fixes #1343

@cla-bot cla-bot Bot added the cla/signed CLA is signed by all contributors of a PR label Mar 19, 2026
When exporting JSON with a limit and a page > 1 set, a leading comma
is added before the first item because ($offset !== 0) evaluates to
true, resulting in invalid JSON.

Replace the offset-based condition with a `$first` flag to track
whether any item has been written yet.

This comment was marked as resolved.

@sukhwinder33445 sukhwinder33445 requested a review from nilmerg March 19, 2026 10:19
@sukhwinder33445 sukhwinder33445 assigned nilmerg and lippserd and unassigned nilmerg Mar 19, 2026
@sukhwinder33445 sukhwinder33445 requested review from lippserd and removed request for nilmerg March 19, 2026 10:23
@lippserd lippserd added this to the 1.4.0 milestone Mar 24, 2026
@lippserd lippserd merged commit b60448b into main Mar 25, 2026
17 checks passed
@lippserd lippserd deleted the fix/json-export branch March 25, 2026 14:11
nilmerg pushed a commit that referenced this pull request Apr 1, 2026
When exporting JSON with a limit and a page > 1 set, a leading comma is added
before the first item because `$offset !== 0` evaluates to true, resulting in
invalid JSON.

Replace the offset‑based condition with a `$first` flag to track whether any
item has been written yet.

(cherry picked from commit b60448b)
@nilmerg nilmerg modified the milestones: 1.4.0, 1.3.1 Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exported json contains a syntax error

4 participants