koxudaxi / pydantic-pycharm-plugin

PyCharm plugin for pydantic. This plugin provides autocompletion, inspection, type-checking, inserting unfilled argument, and more.
https://koxudaxi.github.io/pydantic-pycharm-plugin/
MIT License
451 stars 16 forks source link

(🐞) invalid inspection "cannot specify `Annotated` and value `Field`s together" #960

Open KotlinIsland opened 2 months ago

KotlinIsland commented 2 months ago
from typing import Annotated

from pydantic import BaseModel, BeforeValidator, Field

class A(BaseModel):
    a: Annotated[int, BeforeValidator(lambda x: x + 1)] = Field(None)  # cannot specify `Annotated` and value `Field`s together for 'a'

print(A(a=1))

Maybe this was true for Pydantic 1 or something?