-
Notifications
You must be signed in to change notification settings - Fork 471
Tech debt: Extract OpenAPI schema generation from Route #8097
Copy link
Copy link
Labels
Description
Why is this needed?
Route._get_openapi_path() is 158 lines with deeply nested branches. All the schema generation logic can move to a dedicated class (e.g. RouteSchemaGenerator) that receives a Route and produces the OpenAPI path spec. The Route class drops from 662 to ~400 lines.
Which area does this relate to?
Event Handler - REST API
Suggestion
- Create
openapi/schema_generator.pywith a class that takes a Route - Move
_get_openapi_path,_openapi_operation_metadata,_openapi_operation_parameters,_openapi_operation_request_body,_openapi_operation_returnto the new class - Route delegates to the generator
- No public API changes
Acknowledgment
- This 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Triage