Skip to content

Commit 1b006c9

Browse files
committed
chore(openapi): add FileSchema & HeaderParamSchema helpers
1 parent 3688010 commit 1b006c9

File tree

1 file changed

+16
-0
lines changed
  • aws_lambda_powertools/event_handler/openapi

1 file changed

+16
-0
lines changed

aws_lambda_powertools/event_handler/openapi/models.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,22 @@ class OpenAPI(OpenAPIExtensions):
480480

481481
model_config = MODEL_CONFIG_ALLOW
482482

483+
# Helper schemas for new file & header support
484+
class FileSchema(BaseModel):
485+
"""OpenAPI 3.0 schema for binary file uploads (multipart/form-data)."""
486+
487+
type: Literal["string"] = Field("string", const=True)
488+
format: Literal["binary"] = Field("binary", const=True)
489+
490+
model_config = MODEL_CONFIG_ALLOW
491+
492+
493+
class HeaderParamSchema(BaseModel):
494+
"""Schema for simple string header parameters."""
495+
496+
type: Literal["string"] = Field("string", const=True)
497+
498+
model_config = MODEL_CONFIG_ALLOW
483499

484500
model_rebuild(Schema)
485501
model_rebuild(Operation)

0 commit comments

Comments
 (0)