From 825e5ed9bc27948e4622efe13e33568766670f7c Mon Sep 17 00:00:00 2001
From: Lars Trieloff <trieloff@adobe.com>
Date: Thu, 14 Dec 2017 16:59:10 +0000
Subject: [PATCH] Add example for refs #14

---
 examples/docs/README.md                       |  3 +-
 examples/docs/complex.schema.md               | 85 +++++++++++++++++++
 examples/docs/deepextending.schema.md         |  8 +-
 .../generated-schemas/complex.schema.json     | 24 ++++++
 .../deepextending.schema.json                 |  2 +-
 examples/schemas/complex.schema.json          | 24 ++++++
 examples/schemas/deepextending.schema.json    |  2 +-
 7 files changed, 141 insertions(+), 7 deletions(-)
 create mode 100644 examples/docs/complex.schema.md
 create mode 100644 examples/generated-schemas/complex.schema.json
 create mode 100644 examples/schemas/complex.schema.json

diff --git a/examples/docs/README.md b/examples/docs/README.md
index 63125fd..a5ba12c 100644
--- a/examples/docs/README.md
+++ b/examples/docs/README.md
@@ -8,9 +8,10 @@
 
 * [Abstract](./abstract.schema.md) – `https://example.com/schemas/abstract`
 * [Arrays](./arrays.schema.md) – `https://example.com/schemas/arrays`
+* [Enumerated ](./complex.schema.md) – `https://example.com/schemas/complex`
 * [Constant Types](./constants.schema.md) – `https://example.com/schemas/constants`
 * [Custom](./custom.schema.md) – `https://example.com/schemas/custom`
-* [Custom](./deepextending.schema.md) – `https://example.com/schemas/deepextending`
+* [Deeply Extending](./deepextending.schema.md) – `https://example.com/schemas/deepextending`
 * [Definitions](./definitions.schema.md) – `https://example.com/schemas/definitions`
 * [Enumerated ](./enums.schema.md) – `https://example.com/schemas/enums`
 * [Example](./example.schema.md) – `https://example.com/schemas/example`
diff --git a/examples/docs/complex.schema.md b/examples/docs/complex.schema.md
new file mode 100644
index 0000000..114ef90
--- /dev/null
+++ b/examples/docs/complex.schema.md
@@ -0,0 +1,85 @@
+---
+template: reference
+foo: bar
+---
+
+# Enumerated  Schema
+
+```
+https://example.com/schemas/complex
+```
+
+This is an example schema that uses types defined in other schemas.
+
+| Abstract | Extensible | Custom Properties | Defined In |
+|----------|------------|-------------------|------------|
+| Can be instantiated | No | Forbidden | [complex.schema.json](complex.schema.json) |
+
+## Schema Hierarchy
+
+* Enumerated  `https://example.com/schemas/complex`
+  * [Abstract](abstract.schema.md) `https://example.com/schemas/abstract`
+  * [Simple](simple.schema.md) `https://example.com/schemas/simple`
+
+# Enumerated  Properties
+
+| Property | Type | Required | Defined by |
+|----------|------|----------|------------|
+| [refabstract](#refabstract) | complex | **Required** | Enumerated  (this schema) |
+| [refnamed](#refnamed) | complex | Optional | Enumerated  (this schema) |
+
+## refabstract
+
+
+
+`refabstract`
+* is **required**
+* type: complex
+* defined in this schema
+
+### refabstract Type
+
+Unknown type ``.
+
+```json
+{
+  "properties": {
+    "foo": {
+      "type": "string",
+      "description": "A unique identifier given to every addressable thing."
+    }
+  },
+  "required": true,
+  "simpletype": "complex"
+}
+```
+
+
+
+
+
+## refnamed
+
+
+
+`refnamed`
+* is optional
+* type: complex
+* defined in this schema
+
+### refnamed Type
+
+Unknown type ``.
+
+```json
+{
+  "$ref": "https://example.com/schemas/simple",
+  "$linkVal": "Simple",
+  "$linkPath": "simple.schema.md",
+  "simpletype": "complex"
+}
+```
+
+
+
+
diff --git a/examples/docs/deepextending.schema.md b/examples/docs/deepextending.schema.md
index 6031d94..ab3f4bd 100644
--- a/examples/docs/deepextending.schema.md
+++ b/examples/docs/deepextending.schema.md
@@ -3,7 +3,7 @@ template: reference
 foo: bar
 ---
 
-# Custom Schema
+# Deeply Extending Schema
 
 ```
 https://example.com/schemas/deepextending
@@ -17,19 +17,19 @@ This is an extending schema. It is extending another extending schema. It pulls
 
 ## Schema Hierarchy
 
-* Custom `https://example.com/schemas/deepextending`
+* Deeply Extending `https://example.com/schemas/deepextending`
   * [Extensible](extensible.schema.md) `https://example.com/schemas/extensible`
   * [Definitions](definitions.schema.md) `https://example.com/schemas/definitions`
   * [Extending](extending.schema.md) `https://example.com/schemas/extending`
 
-# Custom Properties
+# Deeply Extending Properties
 
 | Property | Type | Required | Defined by |
 |----------|------|----------|------------|
 | [bar](#bar) | `string` | Optional | [Extensible](extensible.schema.md#bar) |
 | [id](#id) | `string` | Optional | [Definitions](definitions.schema.md#id) |
 | [baz](#baz) | `string` | Optional | [Extending](extending.schema.md#baz) |
-| [hey](#hey) | `string` | Optional | Custom (this schema) |
+| [hey](#hey) | `string` | Optional | Deeply Extending (this schema) |
 
 ## bar
 
diff --git a/examples/generated-schemas/complex.schema.json b/examples/generated-schemas/complex.schema.json
new file mode 100644
index 0000000..c11dfd0
--- /dev/null
+++ b/examples/generated-schemas/complex.schema.json
@@ -0,0 +1,24 @@
+{
+    "meta:license": [
+        "Copyright 2017 Adobe Systems Incorporated. All rights reserved.",
+        "This file is licensed to you under the Apache License, Version 2.0 (the 'License');",
+        "you may not use this file except in compliance with the License. You may obtain a copy",
+        "of the License at http://www.apache.org/licenses/LICENSE-2.0"
+    ],
+    "$schema": "http://json-schema.org/draft-06/schema#",
+    "$id": "https://example.com/schemas/complex",
+    "title": "Enumerated ",
+    "type": "object",
+    "description": "This is an example schema that uses types defined in other schemas.",
+    "properties": {
+        "refabstract": {
+            "$ref": "https://example.com/schemas/abstract#/definitions/first"
+        },
+        "refnamed": {
+            "$ref": "https://example.com/schemas/simple"
+        }
+    },
+    "required": [
+        "refabstract"
+    ]
+}
\ No newline at end of file
diff --git a/examples/generated-schemas/deepextending.schema.json b/examples/generated-schemas/deepextending.schema.json
index b5228aa..72df4ee 100644
--- a/examples/generated-schemas/deepextending.schema.json
+++ b/examples/generated-schemas/deepextending.schema.json
@@ -7,7 +7,7 @@
     ],
     "$schema": "http://json-schema.org/draft-06/schema#",
     "$id": "https://example.com/schemas/deepextending",
-    "title": "Custom",
+    "title": "Deeply Extending",
     "description": "This is an extending schema. It is extending another extending schema. It pulls `definitions` from other schemas.",
     "type": "object",
     "meta:extensible": true,
diff --git a/examples/schemas/complex.schema.json b/examples/schemas/complex.schema.json
new file mode 100644
index 0000000..80e3f7a
--- /dev/null
+++ b/examples/schemas/complex.schema.json
@@ -0,0 +1,24 @@
+{
+  "meta:license": [
+    "Copyright 2017 Adobe Systems Incorporated. All rights reserved.",
+    "This file is licensed to you under the Apache License, Version 2.0 (the 'License');",
+    "you may not use this file except in compliance with the License. You may obtain a copy",
+    "of the License at http://www.apache.org/licenses/LICENSE-2.0"
+  ],
+  "$schema": "http://json-schema.org/draft-06/schema#",
+  "$id": "https://example.com/schemas/complex",
+  "title": "Enumerated ",
+  "type": "object",
+  "description": "This is an example schema that uses types defined in other schemas.",
+  "properties": {
+    "refabstract": {
+      "$ref": "https://example.com/schemas/abstract#/definitions/first"
+    },
+    "refnamed": {
+      "$ref": "https://example.com/schemas/simple"
+    }
+  },
+  "required": [
+    "refabstract"
+  ]
+}
diff --git a/examples/schemas/deepextending.schema.json b/examples/schemas/deepextending.schema.json
index fd0f03e..192707d 100644
--- a/examples/schemas/deepextending.schema.json
+++ b/examples/schemas/deepextending.schema.json
@@ -7,7 +7,7 @@
     ],
     "$schema": "http://json-schema.org/draft-06/schema#",
     "$id": "https://example.com/schemas/deepextending",
-    "title": "Custom",
+    "title": "Deeply Extending",
     "description": "This is an extending schema. It is extending another extending schema. It pulls `definitions` from other schemas.",
     "type": "object",
     "meta:extensible": true,
-- 
GitLab