Skip to content

fix: decode cached JSON as the annotated return type - #576

Open
bezff wants to merge 1 commit into
long2ice:mainfrom
bezff:fix/pydantic-v2-return-type
Open

bezff wants to merge 1 commit into
long2ice:mainfrom
bezff:fix/pydantic-v2-return-type

Conversation

@bezff

@bezff bezff commented Oct 15, 2026

Copy link
Copy Markdown

Summary

  • After Pydantic v2 removed ModelField, JsonCoder.decode_as_type returned raw JSON, so cache hits came back as plain dicts and lists.
  • Decode again with a cached TypeAdapter, so annotated models, dataclasses, and lists of models are restored.
    Fixes PydanticV2 support #249

Pydantic v2 removed ModelField, and the decoder was stubbed out
instead of replaced, so cache hits came back as plain dicts.

This branch has not been deployed

No deployments
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.

PydanticV2 support

1 participant