Skip to content

Optimistically close string values in from_json if allow_partial is set to true #100

Closed
@mwildehahn

Description

@mwildehahn

Right now if you're trying to parse a partial object, pydantic won't return the key until the string value is complete:

In [4]: pydantic_core.from_json('{"test": "this', allow_partial=True)
Out[4]: {}

I'd expect this to result in:

In [5]: pydantic_core.from_json('{"test": "this', allow_partial=True)
Out[5]: {'test': 'this'}

similarly to how objects and lists are optimistically closed during partial rendering.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions