Skip to content

Validate generic container types correctly #9

Description

@kriben

Current fan-in validation is based on issubclass(). Parameterized annotations such as dict[str, RegularSurface] and list[RegularSurface] are not ordinary classes and cannot be validated reliably with issubclass.

TaskMaestro should compare annotations recursively or use Pydantic TypeAdapter:

  • validate collection origin (dict, list, and so on);
  • validate key and value types;
  • support unions and optional values;
  • provide an error showing the complete upstream and downstream annotations.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions