Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.3k
🐛 Fix parameter aliases#14371
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
🐛 Fix parameter aliases#14371
Conversation
…dy` and `Param`This is how it's done in Pydantic's Field:https://github.com/pydantic/pydantic/blob/407934af10962473d8db0b8c693393cad3975eda/pydantic/fields.py#L1346-L1350
| else: | ||
| kwargs["deprecated"]=deprecated | ||
| ifPYDANTIC_V2: | ||
| ifserialization_aliasin (_Unset,None)andisinstance(alias,str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is how it's done in Pydantic's Field:https://github.com/pydantic/pydantic/blob/407934af10962473d8db0b8c693393cad3975eda/pydantic/fields.py#L1346-L1350
| returnfinal_field | ||
| defget_validation_alias(field:ModelField)->str: |
YuriiMotovNov 19, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should we add cache?
Uh oh!
There was an error while loading.Please reload this page.
This PR fixes the rest of failing tests in#14358 (after applying other fixes).
I will update this PR after resolving other issues listed in#14358.
No tests so far, will add some tests if we decide not to merge tests from#14358
Note: for
validation_aliasesonly string value is currently supported. We can later think of supportingAliasPathandAliasChoicesWill also fix issues: