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

Commit 4a76d3d

Browse files
committed
Add a compliance section to the impl data
This adds a structured section on compliance, specifically how to configure for it. This is *not* intended to be the same sort of compliance information that the test suite provides. Rather, it is about things that implementations document that don't necessarily show up in test suite results. This format includes brief instructions and optionally (ideally) a documentation link. I think this langauge is appropriately neutral, and particularly when there is a doc link it feels more like calling attention to something that is already advertised rather than being judgemental. The AJV and Opis cases are straightfoward. The Common Lisp implementation's case of needing to disable automatic downloading is worth a bit of thought as that is a SHOULD NOT rather than a MUST NOT, but this is why the schema description notes that it is the _most_ compliant config, and other configs may still be compliant. Similary, the networknt Java implementation having `nullable` on by default is not technically non-compliant, but it is more compliant to not have it. There may be other compliance configuration changes that need documenting, but these were the ones that I could find with a reasonable amount of effort.
1 parent 3bd88ee commit 4a76d3d

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed

_data/schema.yml

+48
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ $defs:
9595
Additional information. Overly promotional (or critical)
9696
wording should be avoided.
9797
type: string
98+
compliance:
99+
$ref: "#/$defs/compliance"
98100
last-updated:
99101
description: |
100102
The date (in whatever timezone was relevant at the time)
@@ -108,3 +110,49 @@ $defs:
108110
type: string
109111
format: date
110112
pattern: '^\d\d\d\d-[01]\d-[0123]\d$'
113+
compliance:
114+
description: |
115+
The compliance section notes aspects of an implementation's
116+
_default configuration_ that are non-compliant with the
117+
specification in ways that are _not necessarily_ detected
118+
by the test suite. This information is provided based on
119+
implementation documentation.
120+
type: object
121+
unevaluatedProperties: false
122+
properties:
123+
constraints:
124+
description: |
125+
A brief note of design constraints that impacted choices
126+
regarding compliance. This includes things like
127+
targeting memory-constrained environments, or trading
128+
off features for performance. It does not include
129+
opinions regarding the value (or lack thereof) of
130+
the specification requirements.
131+
type: string
132+
config:
133+
description: |
134+
Documents how to configure an implementation to produce
135+
the most specification-compliant behavior if it does
136+
not do so by default. The resulting configuration
137+
may still have incomplete compliance (such as not
138+
having implemented all keywords), but will not
139+
have additional behavior that contradicts the
140+
specification (such as modifying the instance
141+
by filling in default values).
142+
type: object
143+
unevaluatedProperties: false
144+
required: [instructions]
145+
properties:
146+
docs:
147+
description: |
148+
A link to the implementation's configuration
149+
documentation, ideally to whatever part addresses
150+
configuration and compliance.
151+
type: string
152+
format: uri
153+
instructions:
154+
description: |
155+
Instructions to configure for compliance. Will
156+
appear in a sentence after "you must" and before
157+
"to produce specification-compliant behavior."
158+
type: string

_data/validator-libraries-modern.yml

+22-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@
7373
date-draft: [2019-09]
7474
draft: [7, 6, 4]
7575
license: LGPL
76+
compliance:
77+
config:
78+
docs: https://github.com/fisxoj/json-schema/blob/master/README.rst
79+
instructions: |
80+
set `resolve-remote-references` to `nil`
7681
last-updated: "2022-08-31"
7782
- name: Elixir
7883
implementations:
@@ -133,6 +138,10 @@
133138
date-draft: [2020-12, 2019-09]
134139
draft: [7, 6, 4]
135140
license: Apache License 2.0
141+
compliance:
142+
config:
143+
docs: https://github.com/networknt/json-schema-validator/blob/master/doc/config.md
144+
instructions: "set `handleNullableField` to `false`"
136145
last-updated: "2022-08-31"
137146
- name: Snow
138147
url: https://github.com/ssilverman/snowy-json
@@ -164,10 +173,14 @@
164173
last-updated: "2022-08-31"
165174
- name: ajv
166175
url: https://github.com/ajv-validator/ajv
167-
notes: "for Node.js and browsers - supports [user-defined keywords](https://github.com/ajv-validator/ajv/blob/master/docs/keywords.md) and [$data reference](https://github.com/json-schema-org/json-schema-spec/issues/51); _Only specification-compliant when [strict mode](https://ajv.js.org/strict-mode.html) is **disabled.**_"
176+
notes: "for Node.js and browsers - supports [user-defined keywords](https://github.com/ajv-validator/ajv/blob/master/docs/keywords.md) and [$data reference](https://github.com/json-schema-org/json-schema-spec/issues/51)"
168177
date-draft: [2019-09, 2020-12]
169178
draft: [7, 6, 4]
170179
license: MIT
180+
compliance:
181+
config:
182+
docs: https://ajv.js.org/strict-mode.html
183+
instructions: "set option `strict: false`"
171184
last-updated: "2022-08-31"
172185
- name: "@cfworker/json-schema"
173186
url: https://github.com/cfworker/cfworker/blob/master/packages/json-schema/README.md
@@ -248,6 +261,10 @@
248261
date-draft: [2020-12, 2019-09]
249262
draft: [7, 6]
250263
license: "Apache License 2.0"
264+
compliance:
265+
config:
266+
docs: https://opis.io/json-schema/2.x/php-loader.html#parser-options
267+
instructions: 'set several options to their "vanilla" values'
251268
last-updated: "2022-08-31"
252269
- name: Swaggest Json Schema
253270
url: https://github.com/swaggest/php-json-schema
@@ -385,6 +402,10 @@
385402
url: 'https://www.npmjs.com/package/ajv-cli'
386403
date-draft: [2020-12, 2019-09]
387404
draft: [7, 6, 4]
405+
compliance:
406+
config:
407+
docs: https://github.com/ajv-validator/ajv-cli#ajv-options
408+
instructions: "pass `--strict=false`"
388409
last-updated: "2022-08-31"
389410
- name: yajsv
390411
license: MIT

implementations.md

+11
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ Validators
5757
{% endif %}
5858
</li>
5959

60+
{% if implementation.compliance %}
61+
<li><em>Compliance:</em>
62+
{% if implementation.compliance.config.docs %}
63+
This implementation <a href="{{ implementation.compliance.config.docs }}">documents</a> that you must
64+
{% endif %}
65+
{% if implementation.compliance.config.instructions %}
66+
<strong>{{ implementation.compliance.config.instructions | markdownify | remove: '<p>' | remove: '</p>' }}</strong> to produce specification-compliant behavior.
67+
</li>
68+
{% endif %}
69+
{% endif %}
70+
6071
{% if implementation.license %}
6172
<li><em>License:</em>
6273
{{ implementation.license | join: ", " }}

0 commit comments

Comments
 (0)