3 ms·
I would say, focus on what makes your web framework different. i.e. if you want to implement py-to-js, don't also reinvent routing at the same time. Grab an ex
by lozenge 3y ago
I would say, focus on what makes your web framework different.
i.e. if you want to implement py-to-js, don't also reinvent routing at the same time. Grab an existing py-to-js engine and make something tiny with it. If it shows the value of the idea, then it will be picked up by the wider community.
I like the idea of decorators for turning query and body parameters into function parameters, I haven't seen that before, however is there a syntax where I can specify many parameters without taking many LOC?
For example you could have ``@query("name", "age")`` and look at the function signature using the 'inspect' module to determine that name should be a str and age an int. Or maybe ``@query(name=str, age=int)`` .
Also, mention it uses ASGI in the docs, so people are reassured on how to deploy it. And list that it is already compatible with uvicorn and etc.
- matsemann 3y agoThe decorator for body params reminds me a bit of Spring's @RequestBody annotation. However, fastapi manages this without a decorator, only a type hint. Is there any gain doing it like this?
- lozenge 3y agoIt's nice to have explicit demarcation whether the parameter is coming in from the query string or request body.