diff --git a/examples/docs/arrays.schema.md b/examples/docs/arrays.schema.md index e4f9f73dbeb0bdcf40c8cf6fd5b378828f443d1b..a37f8cf68b639d3ff1e080a87de57bf0a529a363 100644 --- a/examples/docs/arrays.schema.md +++ b/examples/docs/arrays.schema.md @@ -25,6 +25,7 @@ This is an example schema with examples for multiple array types and their const | [list](#list) | `string[]` | Optional | Arrays (this schema) | | [listlist](#listlist) | `array[]` | Optional | Arrays (this schema) | | [numlist](#numlist) | `number[]` | Optional | Arrays (this schema) | +| [objectlist](#objectlist) | `object[]` | Optional | Arrays (this schema) | | [stringlistlist](#stringlistlist) | `string[][]` | Optional | Arrays (this schema) | ## boollist @@ -187,6 +188,53 @@ All items must be of the type: +## objectlist + +An array of simple objects + +`objectlist` +* is optional +* type: `object[]` + +* defined in this schema + +### objectlist Type + + +Array type: `object[]` + +All items must be of the type: +Unknown type `object`. + +```json +{ + "type": "array", + "description": "An array of simple objects", + "items": { + "type": "object", + "properties": { + "a": { + "type": "string", + "description": "The a property" + }, + "b": { + "type": "integer", + "description": "The b property" + } + }, + "simpletype": "`object`" + }, + "simpletype": "`object[]`" +} +``` + + + + + + + + ## stringlistlist This is an array of arrays of strings diff --git a/examples/generated-schemas/arrays.schema.json b/examples/generated-schemas/arrays.schema.json index 607a21b4d2fb56518962630f32b77030a397804d..42200b11881d8e45de4408c16596de2d2cbc06c0 100644 --- a/examples/generated-schemas/arrays.schema.json +++ b/examples/generated-schemas/arrays.schema.json @@ -76,6 +76,23 @@ } }, "maxItems": 10 + }, + "objectlist": { + "type": "array", + "description": "An array of simple objects", + "items": { + "type": "object", + "properties": { + "a": { + "type": "string", + "description": "The a property" + }, + "b": { + "type": "integer", + "description": "The b property" + } + } + } } } } \ No newline at end of file diff --git a/examples/schemas/arrays.schema.json b/examples/schemas/arrays.schema.json index 308f676e8dfe94ae76a35316048a63927d860c1b..2d9bb704e7b4c4ee008f8952cd77720c90118658 100644 --- a/examples/schemas/arrays.schema.json +++ b/examples/schemas/arrays.schema.json @@ -76,6 +76,23 @@ } }, "maxItems": 10 + }, + "objectlist": { + "type": "array", + "description": "An array of simple objects", + "items": { + "type": "object", + "properties": { + "a": { + "type": "string", + "description": "The a property" + }, + "b": { + "type":"integer", + "description": "The b property" + } + } + } } } } diff --git a/templates/md/array-type.ejs b/templates/md/array-type.ejs index 1890a8dd4da226582b612296dc888d0b22491053..68f3761ca2178541ed8a6d3a1904605e22a3d49c 100644 --- a/templates/md/array-type.ejs +++ b/templates/md/array-type.ejs @@ -23,7 +23,7 @@ if (schema.items.type==="string") { %><% } else if (schema.items.$ref!==undefined) { %><%- include("referenced-type",{schema:schema.items,_:_}) %> <% } else { %> -Unknown type `<%= schema.type %>`. +Unknown type `<%= schema.items.type %>`. ```json