diff --git a/src/labthings/default_views/actions.py b/src/labthings/default_views/actions.py index 951fa05..aa09fc5 100644 --- a/src/labthings/default_views/actions.py +++ b/src/labthings/default_views/actions.py @@ -28,6 +28,16 @@ def get(self): } +TASK_ID_PARAMETER = { + "name": "task_id", + "in": "path", + "description": "The unique ID of the action", + "required": True, + "schema": {"type": "string"}, + "example": "eeae7ae9-0c0d-45a4-9ef2-7b84bb67a1d1", +} + + class ActionObjectView(View): """Manage a particular action. @@ -37,6 +47,8 @@ class ActionObjectView(View): """ + parameters = [TASK_ID_PARAMETER] + def get(self, task_id): """Show the status of an Action diff --git a/src/labthings/views/builder.py b/src/labthings/views/builder.py index 7403f88..d05b6fa 100644 --- a/src/labthings/views/builder.py +++ b/src/labthings/views/builder.py @@ -50,6 +50,22 @@ def _get(_, path=""): } # Generate a basic property class - generated_class = type(name, (View, object), {"get": _get}) + generated_class = type( + name, + (View, object), + { + "get": _get, + "parameters": [ + { + "name": "path", + "in": "path", + "description": "Path to the static file", + "required": True, + "schema": {"type": "string"}, + "example": "style.css", + } + ], + }, + ) return generated_class