Skip to content

Comments

feat: add strict JSON parsing with String/CharBuffer support#974

Open
Dee66 wants to merge 3 commits intozio:mainfrom
Dee66:feature/issue-712-json-codec
Open

feat: add strict JSON parsing with String/CharBuffer support#974
Dee66 wants to merge 3 commits intozio:mainfrom
Dee66:feature/issue-712-json-codec

Conversation

@Dee66
Copy link

@Dee66 Dee66 commented Dec 31, 2025

Reject JSON input with trailing characters after valid JSON.

Fixes #712

/claim #712

@Dee66
Copy link
Author

Dee66 commented Dec 31, 2025

demo.mp4

@Dee66
Copy link
Author

Dee66 commented Jan 11, 2026

Hi @jdegoes, I just wanted to clear up the confusion regarding the bounty.

This work fulfills the 'Strict JSON Parsing' bounty. The active Algora claim is here: https://algora.io/claims/qd2AdUcS1Scxy7df

I originally opened this in zio-blocks #571, but moved the implementation here to zio-schema following @plokhotnyuk's suggestion that it was a better architectural fit for JsonBinaryCodec.

The logic is complete and there are no merge conflicts. It should be ready to merge or update directly from your end. Let me know if everything looks good to get this settled.

Copy link
Contributor

@987Nabil 987Nabil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New decode methods have nothing to do with the issue and are not needed

@Dee66 Dee66 force-pushed the feature/issue-712-json-codec branch from faeddf9 to c10d722 Compare January 24, 2026 08:37
@Dee66
Copy link
Author

Dee66 commented Jan 24, 2026

@987Nabil

  1. removed the methods as requested
  2. reject JSON with trailing characters - Core fix that adds EOF checking to reject malformed JSON like {}} and "foo""
  3. add type annotations for scala 3 - Compatibility fix adding explicit type annotations for Scala 3 implicit resolution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JsonCodec decoder accepts malformed JSON string with extra characters

2 participants