From 1e5ba4f152720129f8a4e5031674fef6217ea64a Mon Sep 17 00:00:00 2001 From: Lars Trieloff <trieloff@adobe.com> Date: Wed, 25 Apr 2018 14:15:24 +0000 Subject: [PATCH] Include example for an identifiable schema --- examples/docs/README.md | 23 ++++++++++ examples/docs/identifiable.schema.md | 43 +++++++++++++++++++ .../identifiable.schema.json | 25 +++++++++++ examples/schemas/identifiable.schema.json | 25 +++++++++++ spec/examples/identifiable.schema.md | 43 +++++++++++++++++++ 5 files changed, 159 insertions(+) create mode 100644 examples/docs/identifiable.schema.md create mode 100644 examples/generated-schemas/identifiable.schema.json create mode 100644 examples/schemas/identifiable.schema.json create mode 100644 spec/examples/identifiable.schema.md diff --git a/examples/docs/README.md b/examples/docs/README.md index fbbb817..c34cf4c 100644 --- a/examples/docs/README.md +++ b/examples/docs/README.md @@ -3,3 +3,26 @@ # Readme + +## / + +* [Abstract](./abstract.schema.md) – `https://example.com/schemas/abstract` +* [Arrays](./arrays.schema.md) – `https://example.com/schemas/arrays` +* [Complex References ](./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` +* [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` +* [Examples](./examples.schema.md) – `https://example.com/schemas/examples` +* [Extending](./extending.schema.md) – `https://example.com/schemas/extending` +* [Extensible](./extensible.schema.md) – `https://example.com/schemas/extensible` +* [Identifiable](./identifiable.schema.md) – `https://example.com/schemas/identifiable` +* [Simple](./simple.schema.md) – `https://example.com/schemas/simple` +* [Simple Types](./simpletypes.schema.md) – `https://example.com/schemas/simpletypes` +* [Stabilizing](./stabilizing.schema.md) – `https://example.com/schemas/stabilizing` + +## /subdir/ + +* [Subdir](./subdir/subdir.schema.md) – `https://example.com/schemas/subdir/subdir` diff --git a/examples/docs/identifiable.schema.md b/examples/docs/identifiable.schema.md new file mode 100644 index 0000000..836dc17 --- /dev/null +++ b/examples/docs/identifiable.schema.md @@ -0,0 +1,43 @@ +--- +template: reference +foo: bar +--- + +# Identifiable Schema + +``` +https://example.com/schemas/identifiable +``` + +This is a *very* simple example of a JSON schema. There is only one property. + +| [Abstract](../abstract.md) | Extensible | [Status](../status.md) | Identifiable | Custom Properties | Additional Properties | Defined In | +|----------------------------|------------|------------------------|--------------|-------------------|-----------------------|------------| +| Can be instantiated | No | Experimental | Yes | Forbidden | Permitted | [identifiable.schema.json](identifiable.schema.json) | + +# Identifiable Properties + +| Property | Type | Required | Defined by | +|----------|------|----------|------------| +| [@id](#@id) | `string` | Optional | Identifiable (this schema) | +| `*` | any | Additional | this schema *allows* additional properties | + +## @id + +A unique identifier given to every addressable thing. + +`@id` +* is optional +* type: `string` +* defined in this schema + +### @id Type + + +`string` +* format: `uri` – Uniformous Resource Identifier (according to [RFC3986](http://tools.ietf.org/html/rfc3986)) + + + + + diff --git a/examples/generated-schemas/identifiable.schema.json b/examples/generated-schemas/identifiable.schema.json new file mode 100644 index 0000000..94f700f --- /dev/null +++ b/examples/generated-schemas/identifiable.schema.json @@ -0,0 +1,25 @@ +{ + "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/identifiable", + "title": "Identifiable", + "description": "This is a *very* simple example of a JSON schema. There is only one property.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/id" + } + ], + "properties": { + "@id": { + "type": "string", + "format": "uri", + "description": "A unique identifier given to every addressable thing." + } + } +} \ No newline at end of file diff --git a/examples/schemas/identifiable.schema.json b/examples/schemas/identifiable.schema.json new file mode 100644 index 0000000..94d1751 --- /dev/null +++ b/examples/schemas/identifiable.schema.json @@ -0,0 +1,25 @@ +{ + "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/identifiable", + "title": "Identifiable", + "description": "This is a *very* simple example of a JSON schema. There is only one property.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/id" + } + ], + "properties": { + "@id": { + "type": "string", + "format": "uri", + "description": "A unique identifier given to every addressable thing." + } + } +} diff --git a/spec/examples/identifiable.schema.md b/spec/examples/identifiable.schema.md new file mode 100644 index 0000000..836dc17 --- /dev/null +++ b/spec/examples/identifiable.schema.md @@ -0,0 +1,43 @@ +--- +template: reference +foo: bar +--- + +# Identifiable Schema + +``` +https://example.com/schemas/identifiable +``` + +This is a *very* simple example of a JSON schema. There is only one property. + +| [Abstract](../abstract.md) | Extensible | [Status](../status.md) | Identifiable | Custom Properties | Additional Properties | Defined In | +|----------------------------|------------|------------------------|--------------|-------------------|-----------------------|------------| +| Can be instantiated | No | Experimental | Yes | Forbidden | Permitted | [identifiable.schema.json](identifiable.schema.json) | + +# Identifiable Properties + +| Property | Type | Required | Defined by | +|----------|------|----------|------------| +| [@id](#@id) | `string` | Optional | Identifiable (this schema) | +| `*` | any | Additional | this schema *allows* additional properties | + +## @id + +A unique identifier given to every addressable thing. + +`@id` +* is optional +* type: `string` +* defined in this schema + +### @id Type + + +`string` +* format: `uri` – Uniformous Resource Identifier (according to [RFC3986](http://tools.ietf.org/html/rfc3986)) + + + + + -- GitLab