Skip to content

Implements streamed JSON array parsing using pydantic_core.from_json with fallback #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jo-s-eph
Copy link

This PR addresses issue #422 by Integrating pydantic_core.from_json for parsing JSON chunks in iter_streamed_json_array and aiter_streamed_json_arraywith a fallback to the character-by-character parsing with JsonArrayParserState to handle incomplete or malformed JSON.

@jackmpcollins
Copy link
Owner

@jo-s-eph The whole JsonArrayParserState should be gone. In the end I expect there to be less code due from switching to pydantic_core.from_json. My suggested approach is in comment #422 (comment)
Thanks for working on this and let me know if you have any questions I can help with

@felipeadeildo felipeadeildo mentioned this pull request May 6, 2025
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