Skip to content
Snippets Groups Projects
Commit 825e5ed9 authored by Lars Trieloff's avatar Lars Trieloff
Browse files

Add example for refs #14

parent b984cf8d
Branches
Tags
No related merge requests found
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
* [Abstract](./abstract.schema.md)`https://example.com/schemas/abstract` * [Abstract](./abstract.schema.md)`https://example.com/schemas/abstract`
* [Arrays](./arrays.schema.md)`https://example.com/schemas/arrays` * [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` * [Constant Types](./constants.schema.md)`https://example.com/schemas/constants`
* [Custom](./custom.schema.md)`https://example.com/schemas/custom` * [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` * [Definitions](./definitions.schema.md)`https://example.com/schemas/definitions`
* [Enumerated ](./enums.schema.md)`https://example.com/schemas/enums` * [Enumerated ](./enums.schema.md)`https://example.com/schemas/enums`
* [Example](./example.schema.md)`https://example.com/schemas/example` * [Example](./example.schema.md)`https://example.com/schemas/example`
......
---
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"
}
```
...@@ -3,7 +3,7 @@ template: reference ...@@ -3,7 +3,7 @@ template: reference
foo: bar foo: bar
--- ---
# Custom Schema # Deeply Extending Schema
``` ```
https://example.com/schemas/deepextending https://example.com/schemas/deepextending
...@@ -17,19 +17,19 @@ This is an extending schema. It is extending another extending schema. It pulls ...@@ -17,19 +17,19 @@ This is an extending schema. It is extending another extending schema. It pulls
## Schema Hierarchy ## Schema Hierarchy
* Custom `https://example.com/schemas/deepextending` * Deeply Extending `https://example.com/schemas/deepextending`
* [Extensible](extensible.schema.md) `https://example.com/schemas/extensible` * [Extensible](extensible.schema.md) `https://example.com/schemas/extensible`
* [Definitions](definitions.schema.md) `https://example.com/schemas/definitions` * [Definitions](definitions.schema.md) `https://example.com/schemas/definitions`
* [Extending](extending.schema.md) `https://example.com/schemas/extending` * [Extending](extending.schema.md) `https://example.com/schemas/extending`
# Custom Properties # Deeply Extending Properties
| Property | Type | Required | Defined by | | Property | Type | Required | Defined by |
|----------|------|----------|------------| |----------|------|----------|------------|
| [bar](#bar) | `string` | Optional | [Extensible](extensible.schema.md#bar) | | [bar](#bar) | `string` | Optional | [Extensible](extensible.schema.md#bar) |
| [id](#id) | `string` | Optional | [Definitions](definitions.schema.md#id) | | [id](#id) | `string` | Optional | [Definitions](definitions.schema.md#id) |
| [baz](#baz) | `string` | Optional | [Extending](extending.schema.md#baz) | | [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 ## bar
......
{
"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
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
], ],
"$schema": "http://json-schema.org/draft-06/schema#", "$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://example.com/schemas/deepextending", "$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.", "description": "This is an extending schema. It is extending another extending schema. It pulls `definitions` from other schemas.",
"type": "object", "type": "object",
"meta:extensible": true, "meta:extensible": true,
......
{
"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"
]
}
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
], ],
"$schema": "http://json-schema.org/draft-06/schema#", "$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://example.com/schemas/deepextending", "$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.", "description": "This is an extending schema. It is extending another extending schema. It pulls `definitions` from other schemas.",
"type": "object", "type": "object",
"meta:extensible": true, "meta:extensible": true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment