Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
vvcheremushkin committed Aug 14, 2019
1 parent d0f4e71 commit b32ab41
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_packages(package):
"starlette<=1",
"apispec<3",
],
version="0.0.7",
version="0.0.8",
url="https://github.com/slv0/start_resty",
license="BSD",
description="The web framework",
Expand Down
4 changes: 2 additions & 2 deletions star_resty/types/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
P = TypeVar('P')


def json_schema(schema: Union[Schema, Type[Schema]], cls: P,
def json_schema(schema: Union[Schema, Type[Schema]], cls: Type[P],
unknown: str = EXCLUDE) -> P:
return types.new_class('QueryInputParams', (cls,),
exec_body=set_parser(JsonParser.create(schema, unknown=unknown)))


def json_payload(schema: Union[Schema, Type[Schema]], unknown=EXCLUDE) -> Type[Mapping]:
def json_payload(schema: Union[Schema, Type[Schema]], unknown=EXCLUDE) -> Mapping:
return json_schema(schema, Mapping, unknown=unknown)


Expand Down
4 changes: 2 additions & 2 deletions star_resty/types/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
P = TypeVar('P')


def path_schema(schema: Union[Schema, Type[Schema]], cls: P,
def path_schema(schema: Union[Schema, Type[Schema]], cls: Type[P],
unknown=EXCLUDE) -> P:
return types.new_class('PathInputParams', (cls,),
exec_body=set_parser(PathParser.create(schema, unknown=unknown)))


def path(schema: Union[Schema, Type[Schema]], unknown=EXCLUDE) -> Type[Mapping]:
def path(schema: Union[Schema, Type[Schema]], unknown=EXCLUDE) -> Mapping:
return path_schema(schema, Mapping, unknown=unknown)


Expand Down
4 changes: 2 additions & 2 deletions star_resty/types/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
Q = TypeVar('Q')


def query_schema(schema: Union[Schema, Type[Schema]], cls: Q,
def query_schema(schema: Union[Schema, Type[Schema]], cls: Type[Q],
unknown=EXCLUDE) -> Q:
return types.new_class('QueryInputParams', (cls,),
exec_body=set_parser(QueryParser.create(schema, unknown=unknown)))


def query(schema: Union[Schema, Type[Schema]], unknown=EXCLUDE) -> Type[Mapping]:
def query(schema: Union[Schema, Type[Schema]], unknown=EXCLUDE) -> Mapping:
return query_schema(schema, Mapping, unknown=unknown)


Expand Down

0 comments on commit b32ab41

Please sign in to comment.