-
Notifications
You must be signed in to change notification settings - Fork 438
Open
Enhancement
Copy link
Labels
feature-requestfeature requestfeature request
Description
Use case
I’m building a multi-region AWS Lambda API that accepts:
Custom headers for client identification (e.g., X-Customer-Id
)
Multipart/form-data uploads (CSV files up to 5 MB)
Today Powertools’ APIGatewayRestResolver
generates an OpenAPI spec that omits header parameters and file/form bodies, so our consumers cannot rely on the spec for validation or client generation. We end up hand-editing the JSON, which breaks the “single-source-of-truth” goal of Powertools.
Solution/User Experience
Extend OpenAPIConverter
so that when a handler parameter is typed as File
or bytes
(or annotated with content_type="multipart/form-data"
), it generates the correct OpenAPI 3.0 schema:
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
Add header-parameter support
parameters:
- in: header
name: X-Customer-Id
schema:
type: string
required: true
### Alternative solutions
```markdown
Alternative solutions(third text-area lower down)
markdown
We can manually patch the generated OpenAPI JSON or maintain a separate spec file, but that loses all the benefits of automatic generation and risks drift between code and documentation.
Acknowledgment
- This feature request meets Powertools for AWS Lambda (Python) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
Metadata
Metadata
Assignees
Labels
feature-requestfeature requestfeature request
Type
Projects
Status
Backlog