From df0a44058062b1dec57a18fbc2806a3f090e9d03 Mon Sep 17 00:00:00 2001 From: Zoran Sinnema Date: Thu, 8 Sep 2022 13:10:17 +0200 Subject: [PATCH] #563 fix: crashing openapi backend generator for route based params --- .../application-templates/django-app/api/templates/main.jinja2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/cloudharness_utilities/application-templates/django-app/api/templates/main.jinja2 b/tools/cloudharness_utilities/application-templates/django-app/api/templates/main.jinja2 index 06c6159a..dd1fe3be 100644 --- a/tools/cloudharness_utilities/application-templates/django-app/api/templates/main.jinja2 +++ b/tools/cloudharness_utilities/application-templates/django-app/api/templates/main.jinja2 @@ -103,7 +103,8 @@ def {{operation.function_name}}({{operation.snake_case_arguments}}) -> {{operati return api_controller.{{operation.function_name}}( {% endif %} {% for params in operation.snake_case_arguments.split(",") -%} - {% if params %}{{params.split(":")[0]}}={{params.split(":")[0]}}{% if not loop.last %},{% endif %}{% endif %} + {% if params and ':' in params %} + {{params.split(":")[0]}}={{params.split(":")[0]}}, {% endfor -%}) {% endfor %}