3 ms·
But I found one drawback of using FastAPI - defining all inputs in handler function signature is looks bit complicated and verbose. I prefer one input with type
by hyzyla 7y ago
But I found one drawback of using FastAPI - defining all inputs in handler function signature is looks bit complicated and verbose. I prefer one input with type that are structure of another types. Something like this:
class CreatePostInput(InputClass):
text: str
user_id: str
...
@handler.post('/post')
def create_post(input: CreatePostInput):
...