Skip to content

Improve Oracle OSON binary JSON encoding and decoding - #1749

Merged
tsegismont merged 1 commit into
eclipse-vertx:masterfrom
tsegismont:oson
Oct 8, 2026
Merged

tsegismont merged 1 commit into
eclipse-vertx:masterfrom
tsegismont:oson

Conversation

@tsegismont

Copy link
Copy Markdown
Member

Resolves #1703

Read path: handle all OSON extended types (timestamps, intervals, binary) as JSON-safe types that survive JsonObject.encode(). Extended types are converted to strings (timestamps, intervals) or Buffer (binary) since these are the closest JSON-compatible representations that preserve enough information for users to convert back to the original types.

Write path: replace the three-step serialization (JsonObject → JSON text → parse → OSON binary) with a direct OracleJsonGenerator walk over the internal map/list, avoiding unnecessary intermediate representations. Strings stay as strings on the write path because ambiguity makes guessing unsafe (e.g. "P2Y3M" could be a product code).

Assisted-by: Claude Opus 4.6

Resolves eclipse-vertx#1703

Read path: handle all OSON extended types (timestamps, intervals, binary) as JSON-safe types that survive `JsonObject.encode()`.
Extended types are converted to strings (timestamps, intervals) or `Buffer` (binary) since these are the closest JSON-compatible representations that preserve enough information for users to convert back to the original types.

Write path: replace the three-step serialization (`JsonObject` → JSON text → parse → OSON binary) with a direct `OracleJsonGenerator` walk over the internal map/list, avoiding unnecessary intermediate representations. Strings stay as strings on the write path because ambiguity makes guessing unsafe (e.g. "P2Y3M" could be a product code).

Assisted-by: Claude Opus 4.6
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont
tsegismont merged commit cd452f0 into eclipse-vertx:master Oct 8, 2026
20 checks passed
@tsegismont
tsegismont deleted the oson branch October 8, 2026 13:36
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.

Add support for client-side binary OSON encoding/decoding

1 participant