Skip to content

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

@ragne

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 :)

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