changeset 117:d825e5e57818

Set correct upload paths
author Lewin Bormann <lbo@spheniscida.de>
date Sun, 25 Oct 2020 14:11:26 +0100
parents 990d95209b35
children 08e235191347
files generate/generate.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/generate/generate.py	Sun Oct 25 14:11:14 2020 +0100
+++ b/generate/generate.py	Sun Oct 25 14:11:26 2020 +0100
@@ -228,9 +228,7 @@
             struct['optional_fields'] = opt_query_parameters
             frags.append(chevron.render(SchemaDisplayTmpl, struct))
         # Generate parameter types for subresources.
-        frags.extend(
-            generate_params_structs(resource.get('resources', {}), super_name=resourcename,
-                                    global_params=global_params))
+        frags.extend(generate_params_structs(resource.get('resources', {}), super_name=resourcename, global_params=global_params))
     return frags
 
 
@@ -299,6 +297,8 @@
         http_method = method['httpMethod']
         has_global_params = 'parameters' in discdoc
         formatted_path, required_params = resolve_parameters(method['path'])
+        formatted_simple_upload_path, required_params = resolve_parameters(simple_upload_path)
+        formatted_resumable_upload_path, required_params = resolve_parameters(resumable_upload_path)
 
         if is_download:
             data_download = {
@@ -378,8 +378,8 @@
             'in_type': in_type,
             'out_type': out_type,
             'base_path': discdoc['rootUrl'],
-            'simple_rel_path_expr': '"' + simple_upload_path.lstrip('/') + '"',
-            'resumable_rel_path_expr': '"' + resumable_upload_path.lstrip('/') + '"',
+            'simple_rel_path_expr': formatted_simple_upload_path.lstrip('/'),
+            'resumable_rel_path_expr': formatted_resumable_upload_path.lstrip('/'),
             'global_params_name':
             rust_identifier(global_params_name(discdoc.get('name', ''))) if has_global_params else None,
             'params': [{