# generated by datamodel-codegen:
#   filename:  field_validators.json

from __future__ import annotations

from typing import Any

from myapp.validators import validate_name
from pydantic import BaseModel, EmailStr, ValidationInfo, conint, field_validator


class User(BaseModel):
    name: str
    email: EmailStr
    age: conint(ge=0) | None = None

    @field_validator('name', mode='after')
    @classmethod
    def validate_name_validator(cls, v: Any, info: ValidationInfo) -> Any:
        return validate_name(v, info)
