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

Commit f6158ef

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 92e5a1b commit f6158ef

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:
@@ -134,6 +139,10 @@
134139
date-draft: [2020-12, 2019-09]
135140
draft: [7, 6, 4]
136141
license: Apache License 2.0
142+
compliance:
143+
config:
144+
docs: https://github.com/networknt/json-schema-validator/blob/master/doc/config.md
145+
instructions: "set `handleNullableField` to `false`"
137146
last-updated: "2022-08-31"
138147
- name: Snow
139148
url: https://github.com/ssilverman/snowy-json
@@ -165,10 +174,14 @@
165174
last-updated: "2022-08-31"
166175
- name: ajv
167176
url: https://github.com/ajv-validator/ajv
168-
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.**_"
177+
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)"
169178
date-draft: [2019-09, 2020-12]
170179
draft: [7, 6, 4]
171180
license: MIT
181+
compliance:
182+
config:
183+
docs: https://ajv.js.org/strict-mode.html
184+
instructions: "set option `strict: false`"
172185
last-updated: "2022-08-31"
173186
- name: "@cfworker/json-schema"
174187
url: https://github.com/cfworker/cfworker/blob/master/packages/json-schema/README.md
@@ -249,6 +262,10 @@
249262
date-draft: [2020-12, 2019-09]
250263
draft: [7, 6]
251264
license: "Apache License 2.0"
265+
compliance:
266+
config:
267+
docs: https://opis.io/json-schema/2.x/php-loader.html#parser-options
268+
instructions: 'set several options to their "vanilla" values'
252269
last-updated: "2022-08-31"
253270
- name: Swaggest Json Schema
254271
url: https://github.com/swaggest/php-json-schema
@@ -386,6 +403,10 @@
386403
url: 'https://www.npmjs.com/package/ajv-cli'
387404
date-draft: [2020-12, 2019-09]
388405
draft: [7, 6, 4]
406+
compliance:
407+
config:
408+
docs: https://github.com/ajv-validator/ajv-cli#ajv-options
409+
instructions: "pass `--strict=false`"
389410
last-updated: "2022-08-31"
390411
- name: yajsv
391412
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)