Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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):
      ...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: