diff --git a/example/resources/users.py b/example/resources/users.py index a2e547b..b7bea7a 100644 --- a/example/resources/users.py +++ b/example/resources/users.py @@ -138,6 +138,7 @@ def on_post(self, req, resp): :param str email: [in=body required=true] Email :param list[dict] data: [in=body] Extra Data :param list[str] names: [in=body] Names + :param bool valid: [in=body default=False] Valid :param object config: [in=body] Configuration data :accepts [json xml]: The body content type @@ -145,6 +146,4 @@ def on_post(self, req, resp): """ p = req.params users.append(p) - names = p.get("names") - print(names) resp.media = len(users) - 1 diff --git a/pyproject.toml b/pyproject.toml index 5056976..922b15a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = [ [project] name = "reliqua" -version = "0.0.12" +version = "0.0.13" description = "Simple, efficient, intuitive API Framework" readme = "README.md" requires-python = ">=3.8" diff --git a/src/reliqua/middleware.py b/src/reliqua/middleware.py index 63c1742..cf343c0 100644 --- a/src/reliqua/middleware.py +++ b/src/reliqua/middleware.py @@ -173,6 +173,7 @@ def convert(req, parameter, transform=None): :param str transform: Transform method name :return: None """ + transform = transform or parameter.datatype # pre-check if already type converted and skip if needed try: value = req.get_param(parameter.name, required=parameter.required)