Sanitize non-JSON types in simple_return_json #112

Open
perryh wants to merge 1 commit from perryh/perryh-fix-handler-json into main AGit
First-time contributor

Add util function _to_jsonable, which goes in and fixes all dict keys that are not JSON serializable, and recursively explores dictionaries and other collection types to fix any nested dictionaries that may exist.

Add util function `_to_jsonable`, which goes in and fixes all `dict` keys that are not JSON serializable, and recursively explores dictionaries and other collection types to fix any nested dictionaries that may exist.
perryh requested review from hz 2026-09-24 01:16:58 +00:00
perryh changed title from handler's json output attempts to recursively fix nested objects in keys/illegal json to Sanitize non-JSON types in simple_return_json 2026-09-24 01:18:24 +00:00
Author
First-time contributor

4/4 ✅ passed in pytest catsoop/test/test_defaulthandler.py

4/4 ✅ passed in `pytest catsoop/test/test_defaulthandler.py`
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/112/head:perryh/perryh-fix-handler-json'
git switch 'perryh/perryh-fix-handler-json'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'perryh/perryh-fix-handler-json'
git switch 'perryh/perryh-fix-handler-json'
git rebase 'main'
git switch 'main'
git merge --ff-only 'perryh/perryh-fix-handler-json'
git switch 'perryh/perryh-fix-handler-json'
git rebase 'main'
git switch 'main'
git merge --no-ff 'perryh/perryh-fix-handler-json'
git switch 'main'
git merge --squash 'perryh/perryh-fix-handler-json'
git switch 'main'
git merge --ff-only 'perryh/perryh-fix-handler-json'
git switch 'main'
git merge 'perryh/perryh-fix-handler-json'
git push origin 'main'
Sign in to join this conversation.
No reviewers
hz
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
catsoop/catsoop!112
No description provided.