Skip to content
Snippets Groups Projects
Commit 00f62954 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

refactor(schema): default after definition

parent e422ee0e
No related branches found
Tags 39.73.0
No related merge requests found
...@@ -26,23 +26,29 @@ function createSingleConfig(option) { ...@@ -26,23 +26,29 @@ function createSingleConfig(option) {
temp.description = option.description; temp.description = option.description;
} }
temp.type = types[option.type]; temp.type = types[option.type];
if (temp.type === 'array' && option.subType) { if (temp.type === 'array') {
temp.items = { if (option.subType) {
type: types[option.subType], temp.items = {
}; type: types[option.subType],
};
if (option.format) {
temp.items.format = option.format;
}
if (option.allowedValues) {
temp.items.enum = option.allowedValues;
}
}
} else {
if (option.format) { if (option.format) {
temp.items.format = option.format; temp.format = option.format;
}
if (option.allowedValues) {
temp.enum = option.allowedValues;
} }
}
if (option.format && temp.type !== 'array') {
temp.format = option.format;
} }
if (option.default !== undefined) { if (option.default !== undefined) {
temp.default = option.default; temp.default = option.default;
} }
if (option.allowedValues) {
temp.enum = option.allowedValues;
}
if (temp.type === 'object') { if (temp.type === 'object') {
temp.$ref = '#'; temp.$ref = '#';
} }
......
...@@ -121,8 +121,8 @@ ...@@ -121,8 +121,8 @@
"gitFs": { "gitFs": {
"description": "Use git for FS operations instead of API. GitHub only.", "description": "Use git for FS operations instead of API. GitHub only.",
"type": "string", "type": "string",
"default": null, "enum": ["https", "http", "ssh"],
"enum": ["https", "http", "ssh"] "default": null
}, },
"trustLevel": { "trustLevel": {
"description": "Set this to \"high\" if the bot should trust the repository owners/contents", "description": "Set this to \"high\" if the bot should trust the repository owners/contents",
...@@ -240,7 +240,6 @@ ...@@ -240,7 +240,6 @@
"versionScheme": { "versionScheme": {
"description": "Version scheme to use for filtering and comparisons", "description": "Version scheme to use for filtering and comparisons",
"type": "string", "type": "string",
"default": "semver",
"enum": [ "enum": [
"cargo", "cargo",
"composer", "composer",
...@@ -254,7 +253,8 @@ ...@@ -254,7 +253,8 @@
"pep440", "pep440",
"ruby", "ruby",
"semver" "semver"
] ],
"default": "semver"
}, },
"ignoreDeps": { "ignoreDeps": {
"description": "Dependencies to ignore", "description": "Dependencies to ignore",
...@@ -414,8 +414,8 @@ ...@@ -414,8 +414,8 @@
"rangeStrategy": { "rangeStrategy": {
"description": "Policy for how to modify/update existing ranges.", "description": "Policy for how to modify/update existing ranges.",
"type": "string", "type": "string",
"default": "replace", "enum": ["auto", "pin", "bump", "replace", "widen", "update-lockfile"],
"enum": ["auto", "pin", "bump", "replace", "widen", "update-lockfile"] "default": "replace"
}, },
"branchPrefix": { "branchPrefix": {
"description": "Prefix to use for all branch names", "description": "Prefix to use for all branch names",
...@@ -767,8 +767,7 @@ ...@@ -767,8 +767,7 @@
"postUpdateOptions": { "postUpdateOptions": {
"description": "Enable post-update options to be run after package/artifact updating", "description": "Enable post-update options to be run after package/artifact updating",
"type": "array", "type": "array",
"default": [], "default": []
"enum": ["gomodTidy", "npmDedupe", "yarnDedupeFewer", "yarnDedupeHighest"]
}, },
"ruby": { "ruby": {
"description": "Configuration object for ruby language", "description": "Configuration object for ruby language",
...@@ -1079,16 +1078,7 @@ ...@@ -1079,16 +1078,7 @@
"suppressNotifications": { "suppressNotifications": {
"description": "Options to suppress various types of warnings and other notifications", "description": "Options to suppress various types of warnings and other notifications",
"type": "array", "type": "array",
"default": [], "default": []
"enum": [
"prIgnoreNotification",
"prEditNotification",
"branchAutomergeFailure",
"lockFileErrors",
"artifactErrors",
"deprecationWarningIssues",
"onboardingClose"
]
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment