Skip to content

Conversation

@adhtruong
Copy link
Collaborator

@adhtruong adhtruong commented Nov 15, 2025

Description

  • This adds support to use BaseModel.model_validate(..., by_name). This unblocks use cases where the model names are not valid python identifiers
  • Set to False for backwards compatibility but may want to change this to true in future major release

Closes

@adhtruong adhtruong force-pushed the support-pydantic-by-name branch from 8c420da to cea601f Compare November 15, 2025 12:58
@adhtruong adhtruong marked this pull request as ready for review November 15, 2025 13:07
@adhtruong adhtruong force-pushed the support-pydantic-by-name branch from 5df3059 to 10a81c7 Compare November 17, 2025 19:37
@adhtruong adhtruong force-pushed the support-pydantic-by-name branch 2 times, most recently from 96737e2 to e8a206a Compare November 26, 2025 19:50
@adhtruong adhtruong force-pushed the support-pydantic-by-name branch from e8a206a to 5dde9a8 Compare November 26, 2025 20:37
@github-actions
Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/781

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.

Bug: PydanticFactory - ValidationError when using validation_alias on a field Enhancement: Use by_name option for BaseModel.model_validate

2 participants