Skip to content

Expose pydantic's Field(validation_alias=...) parameter #774

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 2 commits into
base: main
Choose a base branch
from

Conversation

rbubley
Copy link

@rbubley rbubley commented Jan 8, 2024

This eases an issue with Multiple Models (table=True model inheriting from table=False model), where input JSON uses aliases.

@rbubley rbubley marked this pull request as draft January 8, 2024 16:31
@rbubley rbubley marked this pull request as ready for review January 8, 2024 17:16
@DurandA
Copy link

DurandA commented Jan 8, 2024

Does this also fix broken field alias since SQLModel 0.0.14? Thanks.

@rbubley
Copy link
Author

rbubley commented Jan 9, 2024

Does this also fix broken field alias since SQLModel 0.0.14? Thanks.

Almost. In your example in #725 you would need secret_name: str = Field(validation_alias="secretName"), and it then works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants