From 1607a8cdd4b0f8108407f70a1a36a0bc36400687 Mon Sep 17 00:00:00 2001 From: Mikko Murto Date: Mon, 23 May 2022 15:23:54 +0300 Subject: [PATCH] Schemas: Add JSON Schema for package configuration Signed-off-by: Mikko Murto --- .../schemas/package-configuration-schema.json | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 integrations/schemas/package-configuration-schema.json diff --git a/integrations/schemas/package-configuration-schema.json b/integrations/schemas/package-configuration-schema.json new file mode 100644 index 0000000000000..0c2cc5efcce83 --- /dev/null +++ b/integrations/schemas/package-configuration-schema.json @@ -0,0 +1,158 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$id": "https://oss-review-toolkit.org/package-configuration.yml", + "title": "ORT package configuration", + "description": "The OSS-Review-Toolkit (ORT) provides a possibility to define path excludes and license finding curations for a specific package (dependency) and provenance in a package configuration file. A full list of all available options can be found at https://github.com/oss-review-toolkit/ort/blob/main/docs/config-file-package-configuration-yml.md.", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "license_finding_curations": { + "items": { + "$ref": "#/definitions/licenseFindingCurations" + }, + "type": "array" + }, + "path_excludes": { + "items": { + "properties": { + "comment": { + "type": "string" + }, + "pattern": { + "type": "string" + }, + "reason": { + "$ref": "#/definitions/pathExcludeReason" + } + }, + "required": [ + "pattern", + "reason" + ], + "type": "object" + }, + "type": "array" + }, + "vcs": { + "$ref": "#/definitions/vcsMatcher" + }, + "source_artifact_url": { + "type": "string" + } + }, + "definitions": { + "licenseFindingCurationReason": { + "enum": [ + "CODE", + "DATA_OF", + "DOCUMENTATION_OF", + "INCORRECT", + "NOT_DETECTED", + "REFERENCE" + ] + }, + "licenseFindingCurations": { + "properties": { + "comment": { + "type": "string" + }, + "concluded_license": { + "type": "string" + }, + "detected_license": { + "type": "string" + }, + "line_count": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "reason": { + "$ref": "#/definitions/licenseFindingCurationReason" + }, + "start_lines": { + "type": [ + "integer", + "string" + ] + } + }, + "required": [ + "path", + "concluded_license", + "reason" + ], + "type": "object" + }, + "pathExcludeReason": { + "enum": [ + "BUILD_TOOL_OF", + "DATA_FILE_OF", + "DOCUMENTATION_OF", + "EXAMPLE_OF", + "OPTIONAL_COMPONENT_OF", + "OTHER", + "PROVIDED_BY", + "TEST_OF", + "TEST_TOOL_OF" + ] + }, + "vcsMatcher": { + "anyOf": [ + { + "required": [ + "type" + ] + }, + { + "required": [ + "url" + ] + }, + { + "required": [ + "revision" + ] + }, + { + "required": [ + "path" + ] + } + ], + "properties": { + "path": { + "type": "string" + }, + "revision": { + "type": "string" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "id" + ], + "oneOf": [ + { + "required": [ + "vcs" + ] + }, + { + "required": [ + "source_artifact_url" + ] + } + ] +}