Skip to content
Snippets Groups Projects
Commit 4fa19225 authored by Lars Trieloff's avatar Lars Trieloff
Browse files

list patternProperties in table of contents #18

parent 0d9497d4
Branches
Tags
No related merge requests found
......@@ -31,6 +31,8 @@ This is an example schema that uses types defined in other schemas.
| [reflist](#reflist) | Simple | Optional | Complex References (this schema) |
| [refnamed](#refnamed) | Simple | Optional | Complex References (this schema) |
| [xor](#xor) | complex | Optional | Complex References (this schema) |
| `int.*` | `integer` | Optional | Complex References (this schema) |
| `str.*` | `string` | Optional | Complex References (this schema) |
| `*` | any | Optional | this schema *allows* additional properties |
## and
......
......@@ -172,7 +172,12 @@ const generateMarkdown = function(filename, schema, schemaPath, outDir, dependen
];
if (_.keys(schema.properties).length > 0) {
multi.push([ 'properties.ejs', { props: requiredProperties(schema.properties, schema.required), title: schema.title, additional: schema.additionalProperties } ]);
multi.push([ 'properties.ejs', {
props: requiredProperties(schema.properties, schema.required),
pprops: _.mapValues(schema.patternProperties, simpletype),
title: schema.title,
additional: schema.additionalProperties
} ]);
for (let i=0; i<_.keys(schema.properties).length;i++) {
const name = _.keys(schema.properties).sort()[i];
multi.push( [ 'property.ejs', {
......
......@@ -18,6 +18,15 @@
%><%= title %> (this schema)<% } %> |
<%
});
%><% _.keys(pprops).forEach(property => {
const schema = pprops[property]; %>
| `<%= property %>` | <%= schema.simpletype %> | Optional | <%
if (schema.$oSchema) {
%>[<%= schema.$oSchema.$linkVal %>](<%= schema.$oSchema.$linkPath %>#<%= property.replace(':', '') %>)<%
} else {
%><%= title %> (this schema)<% } %> |
<%
});
%><% if (additional!==false||additional===undefined) { %>
| `*` | any | Optional | this schema *allows* additional properties |
<% } %>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment