Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,11 @@ const JsonSchemaStaticDocs = require("json-schema-static-docs");
```

All schema documents must use must use `draft-2020-12`, you can not combine this with earlier versions such as `draft-07`.

### Secure Property

To make a schema more secure, you can add a new property "secure" with a value of true. This property indicates that the schema has been reviewed and meets security standards.

```yaml
secure: true
```
22 changes: 9 additions & 13 deletions gh-pages/examples/draft-2020-12/prefix-items.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Draft 2019-09 - Deprecated Example
description: A schema demonstrating use of deprecated
title: Draft 2020-12 - Prefix Items
description: A schema demonstrating the use of prefixItems

---


# Draft 2019-09 - Deprecated Example
# Draft 2020-12 - Prefix Items

<p>A schema demonstrating use of deprecated</p>
<p>A schema demonstrating the use of prefixItems</p>

<table>
<tbody>
Expand Down Expand Up @@ -59,13 +59,11 @@ description: A schema demonstrating use of deprecated
</tbody>
</table>

<hr />

## Security






<p>This schema is secure.</p>

<hr />

Expand All @@ -74,8 +72,8 @@ description: A schema demonstrating use of deprecated
{
"$id": "https://example.com/2020-12-prefix-items.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Draft 2019-09 - Deprecated Example",
"description": "A schema demonstrating use of deprecated",
"title": "Draft 2020-12 - Prefix Items",
"description": "A schema demonstrating the use of prefixItems",
"examples": [
{
"members": [
Expand Down Expand Up @@ -103,5 +101,3 @@ description: A schema demonstrating use of deprecated
}
}
```


5 changes: 3 additions & 2 deletions gh-pages/yml/ajv-2020/draft-2020-12/prefix-items.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"$id": https://example.com/2020-12-prefix-items.json
"$schema": https://json-schema.org/draft/2020-12/schema
title: Draft 2019-09 - Deprecated Example
description: A schema demonstrating use of deprecated
title: Draft 2020-12 - Prefix Items
description: A schema demonstrating the use of prefixItems
examples:
- members:
- 1
Expand All @@ -16,3 +16,4 @@ properties:
minItems: 2
maxItems: 2
items: false
secure: true
18 changes: 18 additions & 0 deletions tests/unit/prefix-items.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const fs = require("fs");
const path = require("path");
const yaml = require("js-yaml");

const schemaPath = path.resolve(__dirname, "../../gh-pages/yml/ajv-2020/draft-2020-12/prefix-items.yml");
const schema = yaml.load(fs.readFileSync(schemaPath, "utf8"));

test("schema title is correct", () => {
expect(schema.title).toBe("Draft 2020-12 - Prefix Items");
});

test("schema description is correct", () => {
expect(schema.description).toBe("A schema demonstrating the use of prefixItems");
});

test("schema is secure", () => {
expect(schema.secure).toBe(true);
});