Skip to content

Commit

Permalink
Update task duration type
Browse files Browse the repository at this point in the history
  • Loading branch information
sevein committed Jul 5, 2024
1 parent e5cde39 commit 92cc131
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 5 additions & 2 deletions typespec/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
11 changes: 8 additions & 3 deletions typespec/tsp-output/@typespec/openapi3/openapi.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 92cc131

Please sign in to comment.