Skip to content

Commit

Permalink
fix(markdown): avoid ambiguities around property names
Browse files Browse the repository at this point in the history
fixes #232
  • Loading branch information
trieloff committed Jun 22, 2020
1 parent 125f590 commit a4543c4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/markdownBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`]))]));
}
Expand Down

0 comments on commit a4543c4

Please sign in to comment.