Skip to content

2.1.0 (2024-05-01)

Compare
Choose a tag to compare
@paulcruse3 paulcruse3 released this 02 May 01:05
· 25 commits to master since this release
c287965

What's Changed

PYDANTIC SUPPORT

You can now use pydantic models as request_body validations. See example below:

from typing import List

from acai_aws.apigateway.requirements import requirements
from pydantic import BaseModel, PositiveInt


class UserRequest(BaseModel):
    id: PositiveInt 
    email: str
    active: bool 
    favorites: List[str]
    notification_config: dict[str, bool]

@requirements(required_body=UserRequest)
def post(_, response):
    response.body = {'pydantic_pass': True}
    return response

Other Changes

Full Changelog: 2.0.1...2.1.0