News for hackers. Stuff that matters.
Re:Types for Python HTTP APIs by hyzyla on Saturday September 14, 2019 @05:56AM (#20969847)
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):
      ...

There are no comments on this comment yet.