From 829bfe680a51cb48d08af9fe3efb9a32c0774c16 Mon Sep 17 00:00:00 2001
From: Lars Trieloff <trieloff@adobe.com>
Date: Fri, 5 Jan 2018 15:50:48 +0000
Subject: [PATCH] additionalProperties are allowed by default #19

---
 examples/docs/arrays.schema.md        | 1 +
 examples/docs/complex.schema.md       | 2 +-
 examples/docs/constants.schema.md     | 1 +
 examples/docs/custom.schema.md        | 1 +
 examples/docs/deepextending.schema.md | 1 +
 examples/docs/definitions.schema.md   | 1 +
 examples/docs/enums.schema.md         | 1 +
 examples/docs/example.schema.md       | 1 +
 examples/docs/examples.schema.md      | 1 +
 examples/docs/extending.schema.md     | 1 +
 examples/docs/simple.schema.md        | 1 +
 examples/docs/simpletypes.schema.md   | 1 +
 templates/md/properties.ejs           | 4 ++--
 13 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/examples/docs/arrays.schema.md b/examples/docs/arrays.schema.md
index 027103d..c5107aa 100644
--- a/examples/docs/arrays.schema.md
+++ b/examples/docs/arrays.schema.md
@@ -27,6 +27,7 @@ This is an example schema with examples for multiple array types and their const
 | [numlist](#numlist) | `number[]` | Optional | Arrays (this schema) |
 | [objectlist](#objectlist) | `object[]` | Optional | Arrays (this schema) |
 | [stringlistlist](#stringlistlist) | `string[][]` | Optional | Arrays (this schema) |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## boollist
 
diff --git a/examples/docs/complex.schema.md b/examples/docs/complex.schema.md
index a6b9690..32d2663 100644
--- a/examples/docs/complex.schema.md
+++ b/examples/docs/complex.schema.md
@@ -31,7 +31,7 @@ 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) |
-| `*` | `any` | Optional | this schema *allows* additional properties |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## and
 
diff --git a/examples/docs/constants.schema.md b/examples/docs/constants.schema.md
index 441894e..0c1dc99 100644
--- a/examples/docs/constants.schema.md
+++ b/examples/docs/constants.schema.md
@@ -20,6 +20,7 @@ This is an example schema with examples for properties with constant values
 | Property | Type | Required | Defined by |
 |----------|------|----------|------------|
 | [hello](#hello) | `const` | **Required** | Constant Types (this schema) |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## hello
 
diff --git a/examples/docs/custom.schema.md b/examples/docs/custom.schema.md
index c091532..66dc032 100644
--- a/examples/docs/custom.schema.md
+++ b/examples/docs/custom.schema.md
@@ -21,6 +21,7 @@ This is an extensible schema. It has `definitions`, that can be used in other sc
 |----------|------|----------|------------|
 | [bar](#bar) | `string` | Optional | Custom (this schema) |
 | [foo](#foo) | `string` | Optional | Custom (this schema) |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## bar
 
diff --git a/examples/docs/deepextending.schema.md b/examples/docs/deepextending.schema.md
index 879b73d..223cf8c 100644
--- a/examples/docs/deepextending.schema.md
+++ b/examples/docs/deepextending.schema.md
@@ -32,6 +32,7 @@ This is an extending schema. It is extending another extending schema. It pulls
 | [hey](#hey) | `string` | Optional | Deeply Extending (this schema) |
 | [id](#id) | `string` | Optional | [Definitions](definitions.schema.md#id) |
 | [meta:id](#metaid) | `string` | Optional | [Definitions](definitions.schema.md#metaid) |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## @id
 
diff --git a/examples/docs/definitions.schema.md b/examples/docs/definitions.schema.md
index 1a2266c..a44a048 100644
--- a/examples/docs/definitions.schema.md
+++ b/examples/docs/definitions.schema.md
@@ -36,6 +36,7 @@ aks.
 | [@id](#@id) | `string` | Optional | Definitions (this schema) |
 | [id](#id) | `string` | **Required** | Definitions (this schema) |
 | [meta:id](#metaid) | `string` | Optional | Definitions (this schema) |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## @id
 
diff --git a/examples/docs/enums.schema.md b/examples/docs/enums.schema.md
index 3510692..dc2be53 100644
--- a/examples/docs/enums.schema.md
+++ b/examples/docs/enums.schema.md
@@ -20,6 +20,7 @@ This is an example schema with examples for properties with enum values
 | Property | Type | Required | Defined by |
 |----------|------|----------|------------|
 | [hello](#hello) | `enum` | **Required** | Enumerated  (this schema) |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## hello
 
diff --git a/examples/docs/example.schema.md b/examples/docs/example.schema.md
index 83bd581..6d0b794 100644
--- a/examples/docs/example.schema.md
+++ b/examples/docs/example.schema.md
@@ -29,6 +29,7 @@ This is an example schema with examples. Too many examples? There can never be t
 |----------|------|----------|------------|
 | [bar](#bar) | `string` | Optional | Example (this schema) |
 | [foo](#foo) | `string` | Optional | Example (this schema) |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## bar
 
diff --git a/examples/docs/examples.schema.md b/examples/docs/examples.schema.md
index 7b1fc7b..fb048ff 100644
--- a/examples/docs/examples.schema.md
+++ b/examples/docs/examples.schema.md
@@ -38,6 +38,7 @@ This is an example schema with *multiple* examples. Too many examples? There can
 |----------|------|----------|------------|
 | [bar](#bar) | `string` | **Required** | Examples (this schema) |
 | [foo](#foo) | `string` | Optional | Examples (this schema) |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## bar
 
diff --git a/examples/docs/extending.schema.md b/examples/docs/extending.schema.md
index e88d7bd..00ecd6b 100644
--- a/examples/docs/extending.schema.md
+++ b/examples/docs/extending.schema.md
@@ -30,6 +30,7 @@ This is an extending schema. It pulls `definitions` from other schemas.
 | [baz](#baz) | `string` | Optional | Extending (this schema) |
 | [id](#id) | `string` | Optional | [Definitions](definitions.schema.md#id) |
 | [meta:id](#metaid) | `string` | Optional | [Definitions](definitions.schema.md#metaid) |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## @id
 
diff --git a/examples/docs/simple.schema.md b/examples/docs/simple.schema.md
index 3e3d687..b3c08dc 100644
--- a/examples/docs/simple.schema.md
+++ b/examples/docs/simple.schema.md
@@ -20,6 +20,7 @@ This is a *very* simple example of a JSON schema. There is only one property.
 | Property | Type | Required | Defined by |
 |----------|------|----------|------------|
 | [id](#id) | `string` | Optional | Simple (this schema) |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## id
 
diff --git a/examples/docs/simpletypes.schema.md b/examples/docs/simpletypes.schema.md
index de8710c..93ddfe5 100644
--- a/examples/docs/simpletypes.schema.md
+++ b/examples/docs/simpletypes.schema.md
@@ -36,6 +36,7 @@ This is an example schema with examples for multiple types and their constraints
 | [string_unconstrained](#string_unconstrained) | `string` | Optional | Simple Types (this schema) |
 | [string_uri](#string_uri) | `string` | Optional | Simple Types (this schema) |
 | [yesno](#yesno) | `boolean` | **Required** | Simple Types (this schema) |
+| `*` | any | Optional | this schema *allows* additional properties |
 
 ## integer_threes
 
diff --git a/templates/md/properties.ejs b/templates/md/properties.ejs
index f248774..b57f6e6 100644
--- a/templates/md/properties.ejs
+++ b/templates/md/properties.ejs
@@ -18,6 +18,6 @@
       %><%= title %> (this schema)<% } %> |
 <%
 });
-%><% if (additional) { %>
-| `*` | `any` | Optional | this schema *allows* additional properties |
+%><% if (additional!==false||additional===undefined) { %>
+| `*` | any | Optional | this schema *allows* additional properties |
 <% } %>
\ No newline at end of file
-- 
GitLab