Skip to content

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

Open
jo-s-eph wants to merge 3 commits intojackmpcollins:mainfrom
jo-s-eph:main
Open

Implements streamed JSON array parsing using pydantic_core.from_json with fallback#437
jo-s-eph wants to merge 3 commits intojackmpcollins:mainfrom
jo-s-eph:main

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