Closed djt closed 1 year ago
Thanks!
We'd like to keep it to Response, even if a bit verbose, to keep the handlers consistent in interface, so we can have the decorators be more portable between functions, and allow for custom middleware
I also realize now that this issue is better suited for the Potassium repo
Just leaving this here for a discussion point. The return response below seems like extra boilerplate.
return Response(status, json)
My perfect solution would be to:
Normal success response
return {'key': 'value'}
Verbose success response
return {'key': 'value'}, 200
Custom status response
return {'error': 'Not Found'}, 404