From e1847363446ead07e5cf5526518317fed0b12487 Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Tue, 1 Dec 2026 18:21:05 +0000 Subject: [PATCH] doc: show real validation responses in the API description The valid example called the three line request example valid, while the API rejects it with eight errors. --- publiccode-validator-api.oas.yaml | 62 ++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/publiccode-validator-api.oas.yaml b/publiccode-validator-api.oas.yaml index 43b5d4d..e4909de 100644 --- a/publiccode-validator-api.oas.yaml +++ b/publiccode-validator-api.oas.yaml @@ -93,18 +93,70 @@ paths: $ref: "#/components/schemas/ValidationResponse" examples: valid: - summary: Valid file + summary: Valid file (testdata/valid.publiccode.yml) value: valid: true results: [] - normalized: "publiccodeYmlVersion: \"0.3\"\nname: My Software\n" + normalized: "publiccodeYmlVersion: \"0\"\nname: Medusa\nurl: https://github.com/example/project.git\nreleaseDate: null\nplatforms:\n- web\ncategories:\n- cloud-management\ndevelopmentStatus: development\nsoftwareType: standalone/other\ndescription:\n en-GB:\n localisedName: Medusa\n genericName: \"\"\n shortDescription: |\n A rather short description which is probably useless\n longDescription: |\n Very long description of this software, also split on multiple rows. You should note what the software is and why one should need it. This is 158 characters. Very long description of this software, also split on multiple rows. You should note what the software is and why one should need it. This is 316 characters. Very long description of this software, also split on multiple rows. You should note what the software is and why one should need it. This is 474 characters. Very long description of this software, also split on multiple rows. You should note what the software is and why one should need it. This is 632 characters.\n features:\n - Just one feature\nlegal:\n license: AGPL-3.0-or-later\nmaintenance:\n type: community\n contacts:\n - name: Francesco Rossi\nlocalisation:\n localisationReady: true\n availableLanguages:\n - en\n" invalid: - summary: Invalid file + summary: Incomplete file (the request example) value: valid: false results: - - key: publiccodeYmlVersion - description: "missing required field" + - file: "" + key: publiccodeYmlVersion + description: "v0.3 is not the latest version, use '0'. Parsing this file as v0.8." + line: 1 + column: 1 + type: warning + - file: "" + key: platforms + description: "platforms must contain more than 0 items" + line: 1 + column: 1 + type: error + - file: "" + key: developmentStatus + description: "developmentStatus is a required field" + line: 1 + column: 1 + type: error + - file: "" + key: softwareType + description: "softwareType is a required field" + line: 1 + column: 1 + type: error + - file: "" + key: description + description: "description must contain more than 0 items" + line: 1 + column: 1 + type: error + - file: "" + key: legal.license + description: "license is a required field" + line: 0 + column: 0 + type: error + - file: "" + key: maintenance.type + description: "type is a required field" + line: 0 + column: 0 + type: error + - file: "" + key: localisation.localisationReady + description: "localisationReady is a required field" + line: 0 + column: 0 + type: error + - file: "" + key: localisation.availableLanguages + description: "availableLanguages is a required field" + line: 0 + column: 0 + type: error normalized: null "400": description: >