Repository navigation
python: Preserve structured JSON payload objects - #722
Merged
Merged
Conversation
Keep JSON payloads as JSON values in the structured CloudEvents data member. Retain base64 for non-JSON structured payloads and raw binary-mode bytes. Correct the inherited-media-type regression's JSON expectation and cover default structured mode, media-type parameters and untyped +json payloads. Refs: #701 Signed-off-by: Clemens Vasters <clemens@vasters.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Restore JSON values in the structured CloudEvents
datamember. The published 0.11.3 producer passes serialized bytes to the formatter, so existing JSON consumers receivedata_base64instead of their previous object-data shape.The SDK's base64 encoding is legal CloudEvents JSON. This repair preserves producer compatibility; it does not relax receiver assertions.
+jsonpayloads.The formatter correction reuses the bounded Kafka hunk from open #712 at
439f7a7a7ad512ed461cf483e574dacf689e5112. It does not include or supersede that PR's remaining generated-type, MQTT or generated-test argument changes.Validation
Local validation used isolated Python 3.11.9, actual PyPI Avrotize 3.9.8, CloudEvents 1.13.0 and native Proton 0.40.0.
$pydenotes that isolated executable.Before the template repair: 3 failed, 1 passed. All three failures are missing
datamembers, including canonical JSON and untyped+jsonwith/without parameters. An earlier exploratory typed+jsoncase hit the existing datatype serializer limitation and is not counted as this regression's red proof.After repair: 35 passed, 104 deselected. One unchanged optional
pytest-asyncioconfiguration warning is retained. Full output was saved under the repository'stmpdirectory.py_compileon the focused generated projects and changed test module: 292 files passed.git diff --check: PASS.gh run watch 46226498342 --repo xregistry/codegen --exit-status --interval 30: PASS, exit 0. All eight suites passed: core, Rust, C#, Java, Java RabbitMQ, TypeScript, other and Go.gh pr checks 722 --repo xregistry/codegen --json name,bucket,state,link: PASS, all eight suites and DCO green; the dependency auto-merge job is an expected skip.8411dec8b29b4487800bd0d53bd4c7183c5838d5, treef3e7b5161bdc0e3c9b7de83421c7aaedd6e7df70. Current main remainsc48d405cd841483800a078da9a2c8aab3cd4d32a.Release boundary
The user approved normal CLI release gates for a fresh immutable 0.11.4 after acceptance on current main. Published 0.11.3 tags/assets will not be overwritten. The expired Marketplace credential in #721 remains outside that CLI-only scope.
Closes #701.
Refs #712 and clemensv/real-time-sources#1743.