You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've made theses modifications in your code to generate "patternProperties" like "properties" :
if (schemaType === 'object') {
if (schema.properties) {
text.push('Properties of the `' + name + '` object:')
generatePropertySection(octothorpes, schema, subSchemas).forEach(function(section) {
text = text.concat(section)
})
}
if (schema.patternProperties) {
text.push('Pattern properties of the `' + name + '` object pattern regexp:')
generatePropertySection(octothorpes, schema, subSchemas).forEach(function(section) {
text = text.concat(section)
})
}
} else if (schemaType === 'array') {
And
function generatePropertySection(octothorpes, schema, subSchemas) {
if (schema.properties) {
return Object.keys(schema.properties).map(function(propertyKey) {
var propertyIsRequired = schema.required && schema.required.indexOf(propertyKey) >= 0
return generateSchemaSectionText(octothorpes + '#', propertyKey, propertyIsRequired, schema.properties[propertyKey], subSchemas)
})
} else if (schema.patternProperties) {
return Object.keys(schema.patternProperties).map(function(patternPropertyKey) {
var patternPropertyIsRequired = schema.required && schema.required.indexOf(patternPropertyKey) >= 0
return generateSchemaSectionText(octothorpes + '#', patternPropertyKey, patternPropertyIsRequired, schema.patternProperties[patternPropertyKey], subSchemas)
})
} else if (schema.oneOf) {
var oneOfList = schema.oneOf.map(function(innerSchema) {
return '* `' + getActualType(innerSchema, subSchemas) + '`'
}).join('\n')
return ['This property must be one of the following types:', oneOfList]
} else {
return []
}
}
I've made theses modifications in your code to generate "patternProperties" like "properties" :
And
It's work very well in my case.
Guillaume
Originally posted by @niji-gmarion in #9 (comment)
The text was updated successfully, but these errors were encountered: