Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Commit 1b79bf7

Browse files
authored
Merge pull request #471 from handrews/compliance
Implementations page: structure, compliant configs, last-updated tracking, built-on links
2 parents 471401f + 1e7b146 commit 1b79bf7

7 files changed

+446
-104
lines changed

.travis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ sudo: false
44
node_js:
55
- node
66
before_script:
7-
- npm install ajv-cli@3.1.0
7+
- npm install ajv-cli@5.0.0 [email protected]
88
- PATH="./node_modules/.bin/:$PATH"
99
script:
1010
- bundle exec jekyll build
11-
- ajv test -s draft-07/schema -d "learn/examples/*.json" --valid --add-used-schema=false
11+
- ajv compile --spec=draft2020 --strict=false -s learn/examples/geographical-location.schema.json -s learn/examples/address.schema.json -s learn/examples/card.schema.json -s learn/examples/calendar.schema.json
12+
- ajv compile --spec=draft2020 --strict=false -c ajv-formats -s _data/schema.yml
13+
- ajv --spec=draft2020 --strict=false -c ajv-formats test -s _data/schema.yml -d "_data/*-libraries-*.yml" --valid

_data/hyper-libraries-modern.yml

+2-7
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
- name: mokkabonna/json-hyper-schema
44
url: "https://github.com/mokkabonna/json-hyper-schema"
55
license: MIT
6+
date-draft: []
67
draft: [7]
7-
- name: Python
8-
implementations:
9-
- name: Core API Hyper-Schema codec
10-
url: "https://github.com/core-api/python-jsonhyperschema-codec"
11-
notes: "Draft-06+ progress: issue [12](https://github.com/core-api/python-jsonhyperschema-codec/issues/12)"
12-
draft: [4]
13-
license: BSD-2-Clause
8+
last-updated: "2022-08-31"

_data/hyper-libraries-obsolete.yml

+9
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,13 @@
33
- name: Jsonary
44
url: "http://jsonary.com/"
55
license: MIT
6+
date-draft: []
67
draft: [4]
8+
- name: Python
9+
implementations:
10+
- name: Core API Hyper-Schema codec
11+
url: "https://github.com/core-api/python-jsonhyperschema-codec"
12+
notes: "Draft-06+ progress: issue [12](https://github.com/core-api/python-jsonhyperschema-codec/issues/12)"
13+
date-draft: []
14+
draft: [4]
15+
license: BSD-2-Clause

_data/schema.yml

+183
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
$schema: https://json-schema.org/draft/2020-12/schema
2+
$id: https://json-schema.org/implementations/schema
3+
type: array
4+
items:
5+
$ref: "#/$defs/language"
6+
$comment: |
7+
The following if/then ensures that if last-updated is used
8+
anywhere, then it is required everywhere. This allows it
9+
to be required in the modern data files and unused in the
10+
obsolete data files.
11+
if:
12+
contains:
13+
required: [implementations]
14+
properties:
15+
implementations:
16+
contains:
17+
required: [last-updated]
18+
then:
19+
properties:
20+
implementations:
21+
items:
22+
required: [last-updated]
23+
$defs:
24+
language:
25+
description: |
26+
A group of implementations grouped by programming language or
27+
runtime environment.
28+
type: object
29+
unevaluatedProperties: false
30+
required: [name]
31+
oneOf:
32+
- required: [implementations]
33+
- required: [notes]
34+
$ref: "#/$defs/name-and-anchor-name"
35+
properties:
36+
implementations:
37+
description: |
38+
The list of implementations for this language/environment,
39+
sorted with those supporting the most recent
40+
drafts/versions first.
41+
type: array
42+
items:
43+
$ref: "#/$defs/implementation"
44+
$comment: |
45+
The following if/then ensures that if the first
46+
if:
47+
prefixItems:
48+
- required: [last-updated]
49+
then:
50+
items:
51+
required: [last-updated]
52+
notes:
53+
type: [string, "null"]
54+
name-and-anchor-name:
55+
$comment: |
56+
Require an anchor-name if the name is not suitable for
57+
use as an anchor (HTML id attribute)
58+
if:
59+
required: [name]
60+
not:
61+
properties:
62+
name:
63+
$ref: "#/$defs/anchor-name"
64+
then:
65+
required: [anchor-name]
66+
properties:
67+
name:
68+
type: string
69+
anchor-name:
70+
$ref: "#/$defs/anchor-name"
71+
anchor-name:
72+
description: |
73+
A name suitable for us as an HTML id, if the regular name
74+
is not a vald id. The regex is looser than the HTML spec
75+
but is based on what was already working on the page.
76+
type: string
77+
pattern: '^[A-Za-z][A-Za-z0-9+-_:./ ()]*$'
78+
implementation:
79+
description: |
80+
An implementation and its associated information.
81+
type: object
82+
unevaluatedProperties: false
83+
required: [name, url]
84+
anyOf:
85+
- required: [draft]
86+
- required: [date-draft]
87+
$ref: "#/$defs/name-and-anchor-name"
88+
properties:
89+
url:
90+
description: |
91+
The URL of the implementation's repository or documentation
92+
type: string
93+
format: uri
94+
draft:
95+
description: The supported drafts (up through draft-07)
96+
type: array
97+
items:
98+
type: integer
99+
enum: [1, 2, 3, 4, 6, 7]
100+
date-draft:
101+
description: The supported drafts (2019-09+)
102+
type: array
103+
items:
104+
type: string
105+
enum: [2019-09, 2020-12]
106+
license:
107+
description: |
108+
The software license under which the implementation
109+
is available
110+
type: string
111+
notes:
112+
description: |
113+
Additional information. Overly promotional (or critical)
114+
wording should be avoided.
115+
type: string
116+
built-on:
117+
description: |
118+
Indicates that this implementation is built on another
119+
implementation, typically to make it available through
120+
a web page, CLI, or a different programming language.
121+
type: object
122+
$ref: "#/$defs/name-and-anchor-name"
123+
compliance:
124+
$ref: "#/$defs/compliance"
125+
last-updated:
126+
description: |
127+
The date (in whatever timezone was relevant at the time)
128+
the information for this entry was last updated. This
129+
should only be changed when the implementation's
130+
documentation has been checked against the entry, not
131+
when minor formatting or other updates are done.
132+
$comment: |
133+
"pattern" does the validation work here, "format" is
134+
just for semantic clarity.
135+
type: string
136+
format: date
137+
pattern: '^\d\d\d\d-[01]\d-[0123]\d$'
138+
compliance:
139+
description: |
140+
The compliance section notes aspects of an implementation's
141+
_default configuration_ that are non-compliant with the
142+
specification in ways that are _not necessarily_ detected
143+
by the test suite. This information is provided based on
144+
implementation documentation.
145+
type: object
146+
unevaluatedProperties: false
147+
properties:
148+
constraints:
149+
description: |
150+
A brief note of design constraints that impacted choices
151+
regarding compliance. This includes things like
152+
targeting memory-constrained environments, or trading
153+
off features for performance. It does not include
154+
opinions regarding the value (or lack thereof) of
155+
the specification requirements.
156+
type: string
157+
config:
158+
description: |
159+
Documents how to configure an implementation to produce
160+
the most specification-compliant behavior if it does
161+
not do so by default. The resulting configuration
162+
may still have incomplete compliance (such as not
163+
having implemented all keywords), but will not
164+
have additional behavior that contradicts the
165+
specification (such as modifying the instance
166+
by filling in default values).
167+
type: object
168+
unevaluatedProperties: false
169+
required: [instructions]
170+
properties:
171+
docs:
172+
description: |
173+
A link to the implementation's configuration
174+
documentation, ideally to whatever part addresses
175+
configuration and compliance.
176+
type: string
177+
format: uri
178+
instructions:
179+
description: |
180+
Instructions to configure for compliance. Will
181+
appear in a sentence after "you must" and before
182+
"to produce specification-compliant behavior."
183+
type: string

0 commit comments

Comments
 (0)