Skip to content

fix: improve json handling on wrong or missing contenttype#297

Open
SaturnFromTitan wants to merge 1 commit into
cloudevents:mainfrom
SaturnFromTitan:fix/jsonformat-content-type
Open

fix: improve json handling on wrong or missing contenttype#297
SaturnFromTitan wants to merge 1 commit into
cloudevents:mainfrom
SaturnFromTitan:fix/jsonformat-content-type

Conversation

@SaturnFromTitan
Copy link
Copy Markdown

@SaturnFromTitan SaturnFromTitan commented May 26, 2026

Related Issue: #291

Type of change:

  • Bug fix (non-breaking change which fixes an issue)

Description:

  • When users set datacontenttype to something like application/octet-stream but pass a dict as data, the JSONFormatter now produces JSON-decodable output.
  • The spec states that when datacontenttype is unspecified, processing SHOULD proceed as if it were application/json.

Pre-submission checklist:

  • I have read the CONTRIBUTING.md file.
  • I have signed off my commits using git commit --signoff.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the documentation (README.md, CHANGELOG.md, etc.) as necessary.
  • I have run pre-commit and tox and all checks pass.
  • This pull request is ready to be reviewed.

Signed-off-by: Martin Winkel <martin@pythomation.de>
@SaturnFromTitan SaturnFromTitan force-pushed the fix/jsonformat-content-type branch from dce3a80 to 5993d79 Compare May 26, 2026 22:31
@SaturnFromTitan SaturnFromTitan marked this pull request as ready for review May 26, 2026 22:31
@SaturnFromTitan
Copy link
Copy Markdown
Author

@xSAVIKx do you see why the tests are not running in this PR?

@xSAVIKx
Copy link
Copy Markdown
Member

xSAVIKx commented May 27, 2026

@xSAVIKx do you see why the tests are not running in this PR?

that's default behavior of github - workflows are halted until a maintainer allows them to run in a PR. Just did that

@SaturnFromTitan
Copy link
Copy Markdown
Author

@xSAVIKx thanks! it's ready for review now ✌️

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.

2 participants