8000 📝 Add documentation about `AliasPath` and `AliasChoices` by Kludex · Pull Request #6129 · pydantic/pydantic · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Restore code annotations
  • Loading branch information
tpdorsey authored Jun 14, 2023
commit 8f674b8de1727beb33273a180ba4dec65342843c
5 changes: 3 additions & 2 deletions docs/usage/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ print(user)
#> first_name='John' last_name='Doe'
```

We are using `model_validate` to validate a dictionary using the field aliases.
You can see more details about [`model_validate`](/api/main/#pydantic.main.BaseModel.model_validate) in the API reference.
1. We are using `model_validate` to validate a dictionary using the field aliases.

You can see more details about [`model_validate`](/api/main/#pydantic.main.BaseModel.model_validate) in the API reference.

In the `'first_name'` field, we are using the alias `'names'` and the index `0` to specify the path to the first name.
In the `'last_name'` field, we are using the alias `'names'` and the index `1` to specify the path to the last name.
Expand Down
0