diff --git a/pyproject.toml b/pyproject.toml index 92beda7..22b614f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "turbosloth" -version = "0.1.0" +version = "0.1.0.post1" description = "ASGI REST framework for lazy devs" authors = [ { name = "nikto_b", email = "niktob560@yandex.ru" } diff --git a/src/turbosloth/__main__.py b/src/turbosloth/__main__.py index e2057ae..7301c8c 100644 --- a/src/turbosloth/__main__.py +++ b/src/turbosloth/__main__.py @@ -145,7 +145,7 @@ async def test_body(r: RequestBody(UserPostSchema), h1: HeaderParam(str, 'header1'), db: DummyDbConnection, user: User, - q2: int = 321) -> (Resp((TestResp, HeadersResp), 200) + q2: int = 321) -> (Resp(TestResp, 200) | Resp(TestResp1, 201) | Resp(ErrResp, 500)): print(r.user_id) @@ -162,7 +162,7 @@ async def test_body(r: RequestBody(UserPostSchema), return ErrResp('hehe'), {} if q1 == 'a': return TestResp1(**resp) - return TestResp(**resp), HeadersResp('asdf') + return TestResp(**resp) @dataclass diff --git a/src/turbosloth/doc/openapi_app.py b/src/turbosloth/doc/openapi_app.py index f72750c..fa31d01 100644 --- a/src/turbosloth/doc/openapi_app.py +++ b/src/turbosloth/doc/openapi_app.py @@ -101,7 +101,7 @@ def type_to_schema(tp, components: Components, *, # Dict if origin is dict: key_type, value_type = args if args else (str, Any) - if key_type is not str: + if key_type is not str and not uuid.UUID: raise ValueError("OpenAPI dict keys must be strings") return Schema( type="object",