Allow route handlers to declare responses with status code categories, i.e. "2XX", "3XX", etc.
I'm happy to send PR if the feature is desirable.
@get(
'/push',
responses={
'2XX': ResponseSpec(SuccessMessage),
'4XX': ResponseSpec(RequestError),
}
)
async def operation(...):...
if I understand it correctly, it only affects generated OpenAPI document.
Users could define common response types for entire status code categories (2XX, 3XX, etc) or (optionally) "default".
The responses map type would need to be extended to support int or str (literal).
New constants may be added for the categories in status_codes or elsewhere.
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too