Hacker News new | ask | show | jobs
by ptwt 2438 days ago
Shameless self plug: a couple of days ago I posted a project that does pretty much the same thing but built on top of flask instead of django: https://github.com/plainas/flask-swagger-types

Also relying on Marshmallow but with the extra bonus of generating an openapi spec for you and hosting swagger ui.

It puzzles me that such approach is not the norm. Interesting to see more people tackling the same problem.

1 comments

Very cool! Yeah, it seems like web frameworks could do more in terms of linking up HTTP contracts with the arguments to the controller/view/whatever. Though, sometimes you need a little more flexibility. For instance, often when updating an existing model, the validation depends not just on the incoming request data but also the value of the existing instance's fields.