Skip to content
This repository has been archived by the owner on May 31, 2019. It is now read-only.

Type Hints for query parameters. #61

Open
c-bata opened this issue Dec 31, 2016 · 0 comments
Open

Type Hints for query parameters. #61

c-bata opened this issue Dec 31, 2016 · 0 comments

Comments

@c-bata
Copy link
Member

c-bata commented Dec 31, 2016

Summary

I want to exploit type hints for converting query parameters.

Description

IDEA 1

from kobin import Kobin, Response, Param

app = Kobin()

@app.route('/tasks/{task_id}')
def index(task_id: int, query_done: Param[bool]) -> Response:
    return Response('Hello World')

IDEA 2

from kobin import Kobin, Response, query_param

app = Kobin()

@app.route('/tasks/{task_id}')
@query_param('query_done')
def index(task_id: int, query_done: bool) -> Response:
    return Response('Hello World')
@c-bata c-bata changed the title Type Hints for query parameters and content Type Hints for query parameters. Dec 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant