mirror of
https://github.com/jambonz/verb-specifications.git
synced 2025-12-19 04:47:47 +00:00
remove properties with undefined values before validation: the SttTask superclass of gather and transcribe creates them for label and callbackVendor
This commit is contained in:
@@ -58,7 +58,8 @@ function validateVerb(name, data, logger) {
|
|||||||
const dSpec = specData.properties[dKey];
|
const dSpec = specData.properties[dKey];
|
||||||
debug(`Task:validate validating property ${dKey} with value ${JSON.stringify(dVal)}`);
|
debug(`Task:validate validating property ${dKey} with value ${JSON.stringify(dVal)}`);
|
||||||
|
|
||||||
if (typeof dSpec === 'string' && dSpec === 'array') {
|
if (typeof dVal === 'undefined') continue;
|
||||||
|
else if (typeof dSpec === 'string' && dSpec === 'array') {
|
||||||
if (!Array.isArray(dVal)) throw new Error(`${name}: property ${dKey} is not an array`);
|
if (!Array.isArray(dVal)) throw new Error(`${name}: property ${dKey} is not an array`);
|
||||||
}
|
}
|
||||||
else if (typeof dSpec === 'string' && dSpec.includes('|')) {
|
else if (typeof dSpec === 'string' && dSpec.includes('|')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user