Skip to content

Clarify JsonFraming object-only behavior#3320

Open
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:fix/json-framing-docs-3244
Open

Clarify JsonFraming object-only behavior#3320
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:fix/json-framing-docs-3244

Conversation

@He-Pin

@He-Pin He-Pin commented Jul 10, 2026

Copy link
Copy Markdown
Member

Motivation

JsonFraming.objectScanner only frames JSON objects, but its API documentation described valid JSON chunks and top-level arrays without explicitly stating that non-object values and a leading UTF-8 BOM are unsupported. This made the intended contract unclear in #3244.

Modification

  • Clarify that the brace-counting operator emits objects and does not validate their contents.
  • Document the supported array-of-objects and object-only JSON Lines/NDJSON inputs, unsupported top-level values, and BOM handling.
  • Keep Scala DSL, Java DSL, and internal parser documentation in sync and link nested JSON use cases to Pekko Connectors.

Result

Users can distinguish object framing from general-purpose JSON parsing and choose the appropriate API without changing runtime behavior.

References

Fixes #3244

Motivation:
JsonFraming.objectScanner documentation could be read as supporting arbitrary top-level JSON values even though it only frames objects.

Modification:
Clarify the object-only contract in Scala, Java, and internal docs, document NDJSON and BOM boundaries, and link nested JSON users to Pekko Connectors.

Result:
Users can distinguish object framing from general-purpose JSON parsing and choose the appropriate API.

Tests:
- Not run - docs only
- sbt "stream / Compile / doc" (passed)
- sbt -Dpekko.genjavadoc.enabled=true Javaunidoc/doc (passed)
- sbt checkCodeStyle (passed)
- sbt +headerCheckAll (passed)
- git diff --check (passed)

References:
Fixes apache#3244
@He-Pin He-Pin added this to the 2.0.0-M4 milestone Jul 10, 2026
@He-Pin He-Pin requested review from Philippus and pjfanning July 11, 2026 10:21
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.

JsonObjectParser rejects valid top-level non-object JSON

1 participant