github aws-powertools/powertools-lambda-python v3.22.0

one day ago

Summary

This release enhances our Event Handler with support for Pydantic Models when validating query strings and headers parameters. This addition brings type safety, automatic validation, and better developer experience to your API endpoints.

A super thanks to @tonnico for implementing this important feature πŸš€ 🌟

πŸ“œ Announcement: You can now find our documentation on the official AWS documentation domain at docs.aws.amazon.com/powertools/python.

Using Pydantic models to validate query strings and headers parameters

Docs

You can now use Pydantic's models to validate query strings and headers parameters. This allows you to have structured, type-safe validation with automatic error handling and clear validation messages.

Why this important:

  • Type safety: Catch validation errors at runtime with clear error messages
  • Developer experience: Get IDE autocompletion and type hints for your parameters
  • Documentation: Self-documenting code through Pydantic model definitions
  • Model reusability: Use the same validation model across multiple endpoints for consistency
carbon (19)

Changes

🌟New features and non-breaking changes

  • feat(event_handler): add support for Pydantic models in Query and Header types (#7253) by @tonnico

πŸ“œ Documentation updates

πŸ› Bug and hot fixes

  • fix(event_handler): Preserve examples field in OpenAPI schema for BedrockAgentResolver (#7561) by @leandrodamascena

πŸ”§ Maintenance

This release was made possible by the following contributors:

@ConnorKirk, @dependabot[bot], @github-actions[bot], @leandrodamascena, @sthulb, @tonnico, dependabot[bot] and github-actions[bot]

Don't miss a new powertools-lambda-python release

NewReleases is sending notifications on new releases.