fix(schema): add freeChoice
This commit is contained in:
Родитель
b7e5546788
Коммит
01e02ff22f
|
@ -40,7 +40,7 @@ function createSingleConfig(option) {
|
|||
if (option.default !== undefined) {
|
||||
temp.default = option.default;
|
||||
}
|
||||
if (temp.type === 'object') {
|
||||
if (temp.type === 'object' && !option.freeChoice) {
|
||||
temp.$ref = '#';
|
||||
}
|
||||
return temp;
|
||||
|
|
|
@ -1553,6 +1553,7 @@ const options = [
|
|||
name: 'prBodyDefinitions',
|
||||
description: 'Table column definitions for use in PR tables',
|
||||
type: 'object',
|
||||
freeChoice: true,
|
||||
mergeable: true,
|
||||
default: {
|
||||
Package: '{{{depName}}}',
|
||||
|
|
|
@ -259,13 +259,18 @@ async function validateConfig(config, isPreset, parentPath) {
|
|||
}
|
||||
} else if (type === 'object') {
|
||||
if (is.object(val)) {
|
||||
const subValidation = await module.exports.validateConfig(
|
||||
val,
|
||||
isPreset,
|
||||
currentPath
|
||||
);
|
||||
warnings = warnings.concat(subValidation.warnings);
|
||||
errors = errors.concat(subValidation.errors);
|
||||
const ignoredObjects = options
|
||||
.filter(option => option.freeChoice)
|
||||
.map(option => option.name);
|
||||
if (!ignoredObjects.includes(key)) {
|
||||
const subValidation = await module.exports.validateConfig(
|
||||
val,
|
||||
isPreset,
|
||||
currentPath
|
||||
);
|
||||
warnings = warnings.concat(subValidation.warnings);
|
||||
errors = errors.concat(subValidation.errors);
|
||||
}
|
||||
} else {
|
||||
errors.push({
|
||||
depName: 'Configuration Error',
|
||||
|
|
|
@ -1073,8 +1073,7 @@
|
|||
"Change": "{{#if displayFrom}}`{{{displayFrom}}}` -> {{else}}{{#if currentValue}}`{{{currentValue}}}` -> {{/if}}{{/if}}{{#if displayTo}}`{{{displayTo}}}`{{else}}`{{{newValue}}}`{{/if}}",
|
||||
"References": "{{{references}}}",
|
||||
"Package file": "{{{packageFile}}}"
|
||||
},
|
||||
"$ref": "#"
|
||||
}
|
||||
},
|
||||
"prBodyColumns": {
|
||||
"description": "List of columns to use in PR bodies",
|
||||
|
|
Загрузка…
Ссылка в новой задаче