Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Make UnionTagNotFound error include expected_tags like it is done for UnionTagInvalid #1762

Description

@ragne

Hey, no sure if this a correct place to ask for the enchantments, but is it possible to add expected_tags to the UnionTagNotFound like it's done with UnionTagInvalid?

What I wanted to achieve is to have that info in the ValidationError that is raised by pydantic so I can construct error messages like Unable to extract tag using discriminator 't'. Valid values are: ${values} for all models that exist in my project. Right now it's possible for union_tag_invalid error, but for union_tag_not_found there's no such fields.

I could work on that if this enchantment is even possible to do :)

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