Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON Schema for package configuration #5370

Merged
Changes from all 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
158 changes: 158 additions & 0 deletions integrations/schemas/package-configuration-schema.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
]
Comment on lines +146 to +157
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: this should be correct according to the JSON Schema spec, but vscode-yaml plugin currently does not correctly handle it. The plugin does not produce error if both vcs and source_artifact_url are provided.

}