From fe42a64672281d367e1b7145fcaac12f8748e0b6 Mon Sep 17 00:00:00 2001
From: Erwan Rouchet <rouchet@teklia.com>
Date: Tue, 10 Jan 2023 10:25:51 +0100
Subject: [PATCH] Disambiguate the two process IDs in the ApplyProcessTemplate
 API docs

---
 arkindex/process/api.py                 | 11 ++++++++++-
 arkindex/process/serializers/imports.py |  7 ++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/arkindex/process/api.py b/arkindex/process/api.py
index f5da3b0ef4..e26d73bb24 100644
--- a/arkindex/process/api.py
+++ b/arkindex/process/api.py
@@ -1752,8 +1752,17 @@ class CreateProcessTemplate(ProcessACLMixin, WorkerACLMixin, CreateAPIView):
 
 @extend_schema_view(post=extend_schema(
     operation_id='ApplyProcessTemplate',
+    parameters=[
+        OpenApiParameter(
+            'id',
+            type=UUID,
+            location=OpenApiParameter.PATH,
+            description='ID of the template to apply',
+            required=True,
+        ),
+    ],
     responses={200: ProcessSerializer, 403: None},
-    tags=['process']
+    tags=['process'],
 ))
 class ApplyProcessTemplate(ProcessACLMixin, WorkerACLMixin, CreateAPIView):
     """
diff --git a/arkindex/process/serializers/imports.py b/arkindex/process/serializers/imports.py
index ecfb9fc8a6..552942a1fe 100644
--- a/arkindex/process/serializers/imports.py
+++ b/arkindex/process/serializers/imports.py
@@ -286,7 +286,12 @@ class CreateProcessTemplateSerializer(serializers.ModelSerializer):
 
 
 class ApplyProcessTemplateSerializer(ProcessACLMixin, serializers.Serializer):
-    process_id = serializers.PrimaryKeyRelatedField(queryset=Process.objects.all(), source='process', required=True)
+    process_id = serializers.PrimaryKeyRelatedField(
+        queryset=Process.objects.all(),
+        source='process',
+        required=True,
+        help_text='ID of the process to apply the template to',
+    )
 
     def create(self, validated_data):
         # The endpoint should copy all the worker runs content from the source template
-- 
GitLab