Skip to content

Bug: Type annotated resolvers not found by OpenAPI merge #8073

@siwyd

Description

@siwyd

Expected Behaviour

OpenAPI merge should find resolvers that are type annotated.

Current Behaviour

When you have the following type annotated resolver (code snippet), OpenAPI merge doesn't find it because it only looks for ast.Assign, and not ast.AnnAssign.

Code snippet

app: APIGatewayRestResolver = APIGatewayRestResolver(enable_validation=True)

Possible Solution

See PR I've created shortly after this.

Steps to Reproduce

Try to run test_file_has_resolver_found with an annotated resolver.

Powertools for AWS Lambda (Python) version

latest

AWS Lambda function runtime

3.14

Packaging format used

PyPi

Debugging logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriagePending triage from maintainers

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions