From 92cc131b6fb267eba9a1b16d6f78b834866a2691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Garc=C3=ADa=20Crespo?= Date: Fri, 5 Jul 2024 06:03:29 +0000 Subject: [PATCH] Update task duration type --- typespec/main.tsp | 7 +++++-- .../tsp-output/@typespec/openapi3/openapi.v1.yaml | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/typespec/main.tsp b/typespec/main.tsp index f7455bf..38d4ca7 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -402,9 +402,12 @@ namespace Service { time_created: timestamp; time_started?: timestamp; time_ended?: timestamp; - // TODO: https://github.com/artefactual/archivematica/blob/c757adeec61bfdb7dfd530a7db9821af4b2af55e/src/dashboard/src/components/helpers.py#L162-L169 - duration: DurationKnownEncoding.seconds; + + @doc("Task duration in seconds (integer). If the duration is less than a second, this will be a \"< 1\" string.") + duration: "< 1" | "" | int64; } + + } @route("/validate") diff --git a/typespec/tsp-output/@typespec/openapi3/openapi.v1.yaml b/typespec/tsp-output/@typespec/openapi3/openapi.v1.yaml index 8d2b2fd..6f0b6c8 100644 --- a/typespec/tsp-output/@typespec/openapi3/openapi.v1.yaml +++ b/typespec/tsp-output/@typespec/openapi3/openapi.v1.yaml @@ -1290,9 +1290,14 @@ components: time_ended: $ref: '#/components/schemas/timestamp' duration: - type: string - enum: - - seconds + anyOf: + - type: string + enum: + - < 1 + - '' + - type: integer + format: int64 + description: Task duration in seconds (integer). If the duration is less than a second, this will be a "< 1" string. V2Beta.Validate.InvalidDocumentResponse: type: object required: