Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/main/resources/wfc/schemas/report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ properties:
#OPTIONAL
extra:
description: "Extra, optional coverage information, collected by different tools."
type: array
type: [array, "null"]
items:
$ref: "#/$defs/Coverage"

Expand All @@ -75,7 +75,7 @@ $defs:
context:
description: "An optional context for the fault. The same fault type could be manifested in different ways, \
and we use this property to differentiate among them."
type: string
type: [string, "null"]
required: ["code"]
TestFilePath:
description: "A relative path used to unique locate a test suite file."
Expand All @@ -89,12 +89,13 @@ $defs:
testCaseId:
$ref: "#/$defs/TestCaseId"
httpStatus:
description: "As in a test case the same endpoint could be called more than once, here we report all of the
obtained HTTP status codes"
type: array
description: "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."
type: [array,"null"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@omursahin I made this change. but now web-report build fails. can you look into it?

items:
$ref: "#/$defs/HttpStatus"
minItems: 1
minItems: 0
uniqueItems: true
required: ["endpointId","testCaseId","httpStatus"]
HttpStatus:
Expand Down Expand Up @@ -198,6 +199,6 @@ $defs:
minimum: 0
total:
description: "Optional number of all testing targets for this criterion. For some criteria, this number can be unknown."
type: integer
type: [integer, "null"]
minimum: 0
required: ["name","covered"]
12 changes: 6 additions & 6 deletions web-report/src/types/GeneratedTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface WebFuzzingCommonsReport {
/**
* Extra, optional coverage information, collected by different tools.
*/
extra?: Coverage[];
extra?: Coverage[] | null;
[k: string]: unknown;
}
export interface Faults {
Expand Down Expand Up @@ -96,7 +96,7 @@ export interface FaultCategoryId {
/**
* An optional context for the fault. The same fault type could be manifested in different ways, and we use this property to differentiate among them.
*/
context?: string;
context?: string | null;
[k: string]: unknown;
}
export interface RESTReport {
Expand All @@ -121,11 +121,11 @@ export interface CoveredEndpoint {
endpointId: OperationId;
testCaseId: TestCaseId;
/**
* As in a test case the same endpoint could be called more than once, here we report all of the obtained HTTP status codes
* 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.
*
* @minItems 1
* @minItems 0
*/
httpStatus: [HttpStatus, ...HttpStatus[]];
httpStatus: HttpStatus[] | null;
[k: string]: unknown;
}
export interface TestCase {
Expand Down Expand Up @@ -165,6 +165,6 @@ export interface CoverageCriterion {
/**
* Optional number of all testing targets for this criterion. For some criteria, this number can be unknown.
*/
total?: number;
total?: number | null;
[k: string]: unknown;
}
8 changes: 4 additions & 4 deletions web-report/src/types/GeneratedTypesZod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ export const testCaseSchema = z.record(z.unknown()).and(
export const faultCategoryIdSchema = z.record(z.unknown()).and(
z.object({
code: z.number(),
context: z.string().optional(),
context: z.string().optional().nullable(),
}),
);

export const coveredEndpointSchema = z.record(z.unknown()).and(
z.object({
endpointId: operationIdSchema,
testCaseId: testCaseIdSchema,
httpStatus: z.tuple([httpStatusSchema]).rest(httpStatusSchema),
httpStatus: z.array(httpStatusSchema).nullable(),
}),
);

export const coverageCriterionSchema = z.record(z.unknown()).and(
z.object({
name: z.string(),
covered: z.number(),
total: z.number().optional(),
total: z.number().optional().nullable(),
}),
);

Expand Down Expand Up @@ -89,6 +89,6 @@ export const webFuzzingCommonsReportSchema = z.record(z.unknown()).and(
totalTests: z.number(),
testFilePaths: z.array(testFilePathSchema),
testCases: z.array(testCaseSchema),
extra: z.array(coverageSchema).optional(),
extra: z.array(coverageSchema).optional().nullable(),
}),
);
Loading