Fix the qlpack json schema

This schema was incorrectly tagging `defaultSuite` properties that
aren't arrays as errors.

I think there are more, similar errors in this schema, but I only fixed
this one so that I can get `github/semmle-code` working with test
discovery.
This commit is contained in:
Andrew Eisenberg
2024-03-28 16:28:36 -07:00
parent a5239fbede
commit e6ebcf4245
4 changed files with 53 additions and 19 deletions

View File

@@ -67,6 +67,9 @@
"$ref": "#/definitions/SuiteInstruction"
}
},
{
"$ref": "#/definitions/SuiteInstruction"
},
{
"type": "null"
}
@@ -93,19 +96,33 @@
"include": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
}
]
}
},
"exclude": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
}
]
}
},
"description": {

View File

@@ -51,6 +51,9 @@
"$ref": "#/definitions/SuiteInstruction"
}
},
{
"$ref": "#/definitions/SuiteInstruction"
},
{
"type": "null"
}
@@ -93,19 +96,33 @@
"include": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
}
]
}
},
"exclude": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
}
]
}
},
"description": {

View File

@@ -10,7 +10,7 @@ export interface QlPackFile {
extensionTargets?: Record<string, string> | null;
dbscheme?: string | null;
library?: boolean | null;
defaultSuite?: SuiteInstruction[] | null;
defaultSuite?: SuiteInstruction[] | SuiteInstruction | null;
defaultSuiteFile?: string | null;
dataExtensions?: string[] | string | null;
}

View File

@@ -5,8 +5,8 @@ export interface SuiteInstruction {
qlpack?: string;
query?: string;
queries?: string;
include?: Record<string, string[]>;
exclude?: Record<string, string[]>;
include?: Record<string, string[] | string>;
exclude?: Record<string, string[] | string>;
description?: string;
import?: string;
from?: string;