Skip to content

Commit 69bdf59

Browse files
barreirojohnaohara
authored andcommitted
Specify the 202 Accepted response in RunService API
1 parent cc2fdc8 commit 69bdf59

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

docs/site/content/en/openapi/openapi.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,10 @@ paths:
662662
format: int32
663663
type: integer
664664
example: 101
665+
"202":
666+
description: The run data will be processed asynchronously
667+
content:
668+
text/plain: {}
665669
"400":
666670
description: Some fields are missing or invalid
667671
content:

horreum-api/src/main/java/io/hyperfoil/tools/horreum/api/services/RunService.java

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ Response add(@QueryParam("test") String testNameOrId,
221221
"]"))
222222
@APIResponses(value = {
223223
@APIResponse(responseCode = "200", description = "id of the newly generated run", content = @Content(mediaType = MediaType.APPLICATION_JSON, schema = @Schema(type = SchemaType.INTEGER, implementation = Integer.class), example = "101")),
224+
@APIResponse(responseCode = "202", description = "The run data will be processed asynchronously", content = @Content(mediaType = MediaType.TEXT_PLAIN)),
224225
@APIResponse(responseCode = "400", description = "Some fields are missing or invalid", content = @Content(mediaType = MediaType.APPLICATION_JSON))
225226
})
226227
@Operation(description = "Upload a new Run")

horreum-web/src/domain/runs/RunImportModal.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export const RunImportModal = (props: RunImportModalProps) => {
6262
)
6363
, alerting, "UPLOAD_ERROR", "Failed to upload run data")
6464
.then(noop)
65+
.catch(noop)
6566
.then(() => props.onClose())
6667

6768
}

0 commit comments

Comments
 (0)