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

Type Hints for query parameters. #61

@c-bata

Description

@c-bata

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')

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions