dutradda/apidaora

Implicit operation return type with response type

Opened this issue · 0 comments

Example:

from http import HTTPStatus
from apidaora import appdaora, MethodType, path

@path('hello', MethodType.GET)
def operation(name: str) -> str:
    return f'Hello {name}!'

@path('hello/{name}', MethodType.POST)
def created_operation(name: str) -> Tuple[HTTPStatus, str]:
    return HTTPStatus.CREATED, f'Hello {name}!'

app = appdaora([operation, created_operation])