Skip to content

Commit 05ef71a

Browse files
committed
making http status nullable
1 parent 4303da4 commit 05ef71a

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/main/resources/wfc/schemas/report.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,13 @@ $defs:
8989
testCaseId:
9090
$ref: "#/$defs/TestCaseId"
9191
httpStatus:
92-
description: "As in a test case the same endpoint could be called more than once, here we report all of the
93-
obtained HTTP status codes"
94-
type: array
92+
description: "As in a test case the same endpoint could be called more than once, here we report all of the \
93+
obtained HTTP status codes. If for any reason a call does not return any response (e.g., the TCP connection \
94+
does timeout), then this HTTP status array would be either null or empty."
95+
type: [array,"null"]
9596
items:
9697
$ref: "#/$defs/HttpStatus"
97-
minItems: 1
98+
minItems: 0
9899
uniqueItems: true
99100
required: ["endpointId","testCaseId","httpStatus"]
100101
HttpStatus:

web-report/src/types/GeneratedTypes.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ export interface CoveredEndpoint {
121121
endpointId: OperationId;
122122
testCaseId: TestCaseId;
123123
/**
124-
* As in a test case the same endpoint could be called more than once, here we report all of the obtained HTTP status codes
124+
* As in a test case the same endpoint could be called more than once, here we report all of the obtained HTTP status codes. If for any reason a call does not return any response (e.g., the TCP connection does timeout), then this HTTP status array would be either null or empty.
125125
*
126-
* @minItems 1
126+
* @minItems 0
127127
*/
128-
httpStatus: [HttpStatus, ...HttpStatus[]];
128+
httpStatus: HttpStatus[] | null;
129129
[k: string]: unknown;
130130
}
131131
export interface TestCase {

web-report/src/types/GeneratedTypesZod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const coveredEndpointSchema = z.record(z.unknown()).and(
3030
z.object({
3131
endpointId: operationIdSchema,
3232
testCaseId: testCaseIdSchema,
33-
httpStatus: z.tuple([httpStatusSchema]).rest(httpStatusSchema),
33+
httpStatus: z.array(httpStatusSchema).nullable(),
3434
}),
3535
);
3636

0 commit comments

Comments
 (0)