diff --git a/publiccode-validator-api.oas.yaml b/publiccode-validator-api.oas.yaml index e4909de..0cc6979 100644 --- a/publiccode-validator-api.oas.yaml +++ b/publiccode-validator-api.oas.yaml @@ -270,14 +270,14 @@ components: properties: valid: type: boolean - description: Whether the file passed validation with no errors + description: > + Whether the file passed validation. False when any entry of + results has type error. Warnings alone keep it true. results: type: array description: List of validation issues (warnings and errors) items: - type: object - description: A validation issue - additionalProperties: true + $ref: "#/components/schemas/ValidationResult" normalized: description: > Normalized publiccode.yml content, present only when @@ -286,6 +286,41 @@ components: - type: string - type: "null" + ValidationResult: + description: A validation issue + type: object + required: [file, key, description, line, column, type] + properties: + file: + type: string + description: > + Name of the validated file. Always empty, since the file + is sent in the request body. + key: + type: string + description: > + Dotted path of the key the issue refers to, such as + legal.license. Empty for issues about the whole file. + example: legal.license + description: + type: string + description: Human-readable description of the issue + example: license is a required field + line: + type: integer + format: int32 + description: Line of the issue, 1-based. 0 when unknown + minimum: 0 + column: + type: integer + format: int32 + description: Column of the issue, 1-based. 0 when unknown + minimum: 0 + type: + type: string + description: Whether the issue is an error or a warning + enum: [error, warning] + ProblemJSON: description: Error response following RFC 9457 (Problem Details for HTTP APIs) type: object