10000 `Field` doesn't play well with `TypeAliasType` · Issue #6352 · pydantic/pydantic · GitHub
[go: up one dir, main page]

Skip to content
Field doesn't play well with TypeAliasType #6352
@adriangb

Description

@adriangb
from typing import Annotated
from typing_extensions import TypeAliasType

from pydantic import Field, BaseModel

SomeAlias = TypeAliasType('SomeAlias', Annotated[int, Field(description='number')])

class Model(BaseModel):
    foo: Annotated[SomeAlias, Field(title='abc')]


print(Model.model_json_schema())  # description gets dropped

Selected Assignee: @hramezani

Metadata

Metadata

Assignees

Labels

bug V2Bug related to Pydantic V2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0