Skip to content

feature: when unwrapping Annotated types, validators seemingly do not get picked up #36

@maxschulz-COL

Description

@maxschulz-COL

Is your feature request related to a problem? Please describe.

Let me reopen a follow up from the previous issue:

If using the Annotated pattern to define validators as shown above, it seems that while we can unwrap the annotation (which fixes most of the issues), it does not pick up on the validator itself.

E.g. when defining

def random_add(v: str) -> str:
    return v + "1"

with

    field_without_default: Annotated[str, AfterValidator(random_add)]
    """Shows the *[Required]* marker in the signature."""

the outcome does not show under validators

Image

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions