diff --git a/examples/docs/abstract.schema.md b/examples/docs/abstract.schema.md index d233ffd7f15fc6bae99fb201e2b5bed9942d89d3..8782a9d187859d6cd4e78fb3ffd494b9bb3d2db5 100644 --- a/examples/docs/abstract.schema.md +++ b/examples/docs/abstract.schema.md @@ -17,10 +17,10 @@ This is an abstract schema. It has `definitions`, but does not declare any prope # Abstract Definitions -| Property | Type | -|----------|------| -| [foo](#foo) | `string` | -| [bar](#bar) | `string` | +| Property | Type | Group | +|----------|------|-------| +| [foo](#foo) | `string` | `#/definitions/first` | +| [bar](#bar) | `string` | `#/definitions/second` | ## foo diff --git a/examples/docs/extensible.schema.md b/examples/docs/extensible.schema.md index 7c9a325156075d2eb1ac781f8340771bdccd1745..889086ffc2ee64bf829880d0d265891ed16fbd3a 100644 --- a/examples/docs/extensible.schema.md +++ b/examples/docs/extensible.schema.md @@ -17,10 +17,10 @@ This is an extensible schema. It has `definitions`, that can be used in other sc # Extensible Definitions -| Property | Type | -|----------|------| -| [foo](#foo) | `string` | -| [bar](#bar) | `string` | +| Property | Type | Group | +|----------|------|-------| +| [foo](#foo) | `string` | `#/definitions/first` | +| [bar](#bar) | `string` | `#/definitions/second` | ## foo diff --git a/examples/docs/subdir/subdir.schema.md b/examples/docs/subdir/subdir.schema.md index 4f00d1f0c63b1a69263e0a5010b7dce51a2d2529..53dfc8c9b434d9acd655aa59e307bd532ce25286 100644 --- a/examples/docs/subdir/subdir.schema.md +++ b/examples/docs/subdir/subdir.schema.md @@ -17,9 +17,9 @@ A schema in a sub directory # Subdir Definitions -| Property | Type | -|----------|------| -| [id](#id) | `string` | +| Property | Type | Group | +|----------|------|-------| +| [id](#id) | `string` | `#/definitions/content` | ## id diff --git a/lib/markdownWriter.js b/lib/markdownWriter.js index 4b9529cfc1e3428e16a9164a1ee635d5f8db1acc..622476bdfa17128e42b6c3a2297e7b8447413205 100644 --- a/lib/markdownWriter.js +++ b/lib/markdownWriter.js @@ -175,6 +175,7 @@ const generateMarkdown = function(filename, schema, schemaPath, outDir, dependen const property = definition[_.keys(definition)[j]]; //console.log('Checking ' + name + ' against ' + _.keys(schema.properties)); if (_.keys(schema.properties).indexOf(name)===-1) { + property.definitiongroup = _.keys(schema.definitions)[i]; abstract[name] = property; } } diff --git a/templates/md/definitions.ejs b/templates/md/definitions.ejs index 4b0295531fc6793246eb64ddb77006fce23a08e2..3c159187e5cf4fbd5d03cab872a8226707a9145a 100644 --- a/templates/md/definitions.ejs +++ b/templates/md/definitions.ejs @@ -8,8 +8,8 @@ -| Property | Type | -|----------|------| +| Property | Type | Group | +|----------|------|-------| <% _.forIn(props, (schema, property, object) => { %> -| [<%= property %>](#<%= property %>) | <%= schema.simpletype %> | +| [<%= property %>](#<%= property %>) | <%= schema.simpletype %> | `#/definitions/<%= schema.definitiongroup %>` | <% }); %> \ No newline at end of file