Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

JacobHayes/pydantic-annotated

Repository files navigation

pydantic-annotated

Proof of concept Decomposing Field components into Annotated.

NOTICE

This package is no longer maintained and has been superseded by annotated-types.


from typing import Annotated

from pydantic_annotated import BaseModel, Description, FieldAnnotationModel


class PII(FieldAnnotationModel):
    status: bool


class ComplexAnnotation(FieldAnnotationModel):
    x: int
    y: int


class Patient(BaseModel):
    name: str
    condition: Annotated[
        str,
        ComplexAnnotation(x=1, y=2),
        Description("Patient condition"),
        PII(status=True),
    ]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published