Skip to content

Commit

Permalink
Update fields.md (#7744) with docs fix for VSCode workaround
Browse files Browse the repository at this point in the history
Co-authored-by: sydney-runkle <sydneymarierunkle@gmail.com>
  • Loading branch information
bn-l and sydney-runkle committed Oct 25, 2023
1 parent 18c3880 commit 0a2d1df
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/concepts/fields.md
Expand Up @@ -191,10 +191,14 @@ print(user.model_dump(by_alias=True)) # (2)!
class User(BaseModel):
model_config = ConfigDict(populate_by_name=True)

name: str = Field(..., alias='username')
name: str = Field(..., alias=str('username')) # noqa: UP018


user = User(name='johndoe') # (1)!
```
1. Now VSCode will not show a warning

This is discussed in more detail in [this issue](https://github.com/pydantic/pydantic/issues/5893).
This is discussed in more detail in [this issue](https://github.com/pydantic/pydantic/issues/5893).

### Validation Alias

Expand Down

0 comments on commit 0a2d1df

Please sign in to comment.