Skip to content

Parser (Pydantic) re-export Pydantic errors for data model validation  #1687

Closed
@kPOWz

Description

@kPOWz

Use case

When writing validators and root validators it is useful to keep error formats consistent with the Pydantic TypeErrors and ValueErrors from the Pydantic errors module

Due to how Pydantic is packaged, these errors are not exported by https://github.com/awslabs/aws-lambda-powertools-python/blob/develop/aws_lambda_powertools/utilities/parser/pydantic.py#L5

https://awslabs.github.io/aws-lambda-powertools-python/2.1.0/utilities/parser/#data-model-validation

Solution/User Experience

re-export the LPT packaged Pydantic errors module under from aws_lambda_powertools.utilities.parser.pydantic.errors

ensure this will still work smoothly after switch to rust / pydantic core

Alternative solutions

No response

Acknowledgment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions