diff --git a/lib/markdownBuilder.js b/lib/markdownBuilder.js index 5f9628b8..49c8dd29 100644 --- a/lib/markdownBuilder.js +++ b/lib/markdownBuilder.js @@ -558,33 +558,33 @@ function build({ // https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.2 - if (schema[keyword`multipleOf`] !== undefined) { + if (schema[keyword`multipleOf`] !== undefined && typeof schema[keyword`multipleOf`] === 'number') { // console.log('multiple!', schema[s.filename], schema[s.pointer]); constraints.push(paragraph([strong(text(i18n`multiple of`)), text(': '), text(i18n`the value of this number must be a multiple of: `), inlineCode(String(schema[keyword`multipleOf`]))])); } - if (schema[keyword`maximum`] !== undefined) { + if (schema[keyword`maximum`] !== undefined && typeof schema[keyword`maximum`] === 'number') { // console.log('maximum!', schema[s.filename], schema[s.pointer]); constraints.push(paragraph([strong(text(i18n`maximum`)), text(': '), text(i18n`the value of this number must smaller than or equal to: `), inlineCode(String(schema[keyword`maximum`]))])); } - if (schema[keyword`exclusiveMaximum`] !== undefined) { + if (schema[keyword`exclusiveMaximum`] !== undefined && typeof schema[keyword`exclusiveMaximum`] === 'number') { // console.log('exclusiveMaximum!', schema[s.filename], schema[s.pointer]); constraints.push(paragraph([strong(text(i18n`maximum (exclusive)`)), text(': '), text(i18n`the value of this number must be smaller than: `), inlineCode(String(schema[keyword`exclusiveMaximum`]))])); } - if (schema[keyword`minimum`] !== undefined) { + if (schema[keyword`minimum`] !== undefined && typeof schema[keyword`minimum`] === 'number') { // console.log('minimum!', schema[s.filename], schema[s.pointer]); constraints.push(paragraph([strong(text(i18n`minimum`)), text(': '), text(i18n`the value of this number must greater than or equal to: `), inlineCode(String(schema[keyword`minimum`]))])); } - if (schema[keyword`exclusiveMinimum`] !== undefined) { + if (schema[keyword`exclusiveMinimum`] !== undefined && typeof schema[keyword`exclusiveMinimum`] === 'number') { // console.log('exclusiveMinimum!', schema[s.filename], schema[s.pointer]); constraints.push(paragraph([strong(text(i18n`minimum (exclusive)`)), text(': '), text(i18n`the value of this number must be greater than: `), inlineCode(String(schema[keyword`exclusiveMinimum`]))])); } // https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.6.3 - if (schema[keyword`maxLength`] !== undefined) { + if (schema[keyword`maxLength`] !== undefined && typeof schema[keyword`maxLength`] === 'number') { // console.log('maxLength!', schema[s.filename], schema[s.pointer]); constraints.push(paragraph([strong(text(i18n`maximum length`)), text(': '), text(i18n`the maximum number of characters for this string is: `), inlineCode(String(schema[keyword`maxLength`]))])); } - if (schema[keyword`minLength`] !== undefined) { + if (schema[keyword`minLength`] !== undefined && typeof schema[keyword`minLength`] === 'number') { // console.log('minLength!', schema[s.filename], schema[s.pointer]); constraints.push(paragraph([strong(text(i18n`minimum length`)), text(': '), text(i18n`the minimum number of characters for this string is: `), inlineCode(String(schema[keyword`minLength`]))])); }