-
Notifications
You must be signed in to change notification settings - Fork 473
Tech debt: Consolidate parameter class constructors #8118
Copy link
Copy link
Labels
pending-releaseFix or implementation already in dev waiting to be releasedFix or implementation already in dev waiting to be releasedtech-debtTechnical Debt tasksTechnical Debt tasks
Description
Why is this needed?
Path, Query, Header, Cookie all inherit from Param but each one copies the entire __init__ with 25+ parameters. The __init__ can live only in Param. Subclasses just set in_ and override specific behavior (e.g. Header has convert_underscores).
Same story for Body/Form/File.
Steps:
- Move the full
__init__to Param base class - Subclasses override only what differs (default value, alias behavior)
- Keep class names and import paths identical
- Verify Pydantic FieldInfo compatibility
Which area does this relate to?
Event Handler - REST API
Suggestion
No response
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
pending-releaseFix or implementation already in dev waiting to be releasedFix or implementation already in dev waiting to be releasedtech-debtTechnical Debt tasksTechnical Debt tasks
Type
Projects
Status
Coming soon