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

Implementations page: structure, compliant configs, last-updated tracking, built-on links #471

Merged
merged 6 commits into from
Sep 6, 2022
Merged
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
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ sudo: false
node_js:
- node
before_script:
- npm install ajv-cli@3.1.0
- npm install ajv-cli@5.0.0 [email protected]
- PATH="./node_modules/.bin/:$PATH"
script:
- bundle exec jekyll build
- ajv test -s draft-07/schema -d "learn/examples/*.json" --valid --add-used-schema=false
- 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
- ajv compile --spec=draft2020 --strict=false -c ajv-formats -s _data/schema.yml
- ajv --spec=draft2020 --strict=false -c ajv-formats test -s _data/schema.yml -d "_data/*-libraries-*.yml" --valid
9 changes: 2 additions & 7 deletions _data/hyper-libraries-modern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
- name: mokkabonna/json-hyper-schema
url: "https://github.com/mokkabonna/json-hyper-schema"
license: MIT
date-draft: []
draft: [7]
- name: Python
implementations:
- name: Core API Hyper-Schema codec
url: "https://github.com/core-api/python-jsonhyperschema-codec"
notes: "Draft-06+ progress: issue [12](https://github.com/core-api/python-jsonhyperschema-codec/issues/12)"
draft: [4]
license: BSD-2-Clause
last-updated: "2022-08-31"
9 changes: 9 additions & 0 deletions _data/hyper-libraries-obsolete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@
- name: Jsonary
url: "http://jsonary.com/"
license: MIT
date-draft: []
draft: [4]
- name: Python
implementations:
- name: Core API Hyper-Schema codec
url: "https://github.com/core-api/python-jsonhyperschema-codec"
notes: "Draft-06+ progress: issue [12](https://github.com/core-api/python-jsonhyperschema-codec/issues/12)"
date-draft: []
draft: [4]
license: BSD-2-Clause
183 changes: 183 additions & 0 deletions _data/schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
$schema: https://json-schema.org/draft/2020-12/schema
$id: https://json-schema.org/implementations/schema
type: array
items:
$ref: "#/$defs/language"
$comment: |
The following if/then ensures that if last-updated is used
anywhere, then it is required everywhere. This allows it
to be required in the modern data files and unused in the
obsolete data files.
if:
contains:
required: [implementations]
properties:
implementations:
contains:
required: [last-updated]
then:
properties:
implementations:
items:
required: [last-updated]
$defs:
language:
description: |
A group of implementations grouped by programming language or
runtime environment.
type: object
unevaluatedProperties: false
required: [name]
oneOf:
- required: [implementations]
- required: [notes]
$ref: "#/$defs/name-and-anchor-name"
properties:
implementations:
description: |
The list of implementations for this language/environment,
sorted with those supporting the most recent
drafts/versions first.
type: array
items:
$ref: "#/$defs/implementation"
$comment: |
The following if/then ensures that if the first
if:
prefixItems:
- required: [last-updated]
then:
items:
required: [last-updated]
notes:
type: [string, "null"]
name-and-anchor-name:
$comment: |
Require an anchor-name if the name is not suitable for
use as an anchor (HTML id attribute)
if:
required: [name]
not:
properties:
name:
$ref: "#/$defs/anchor-name"
then:
required: [anchor-name]
properties:
name:
type: string
anchor-name:
$ref: "#/$defs/anchor-name"
anchor-name:
description: |
A name suitable for us as an HTML id, if the regular name
is not a vald id. The regex is looser than the HTML spec
but is based on what was already working on the page.
type: string
pattern: '^[A-Za-z][A-Za-z0-9+-_:./ ()]*$'
implementation:
description: |
An implementation and its associated information.
type: object
unevaluatedProperties: false
required: [name, url]
anyOf:
- required: [draft]
- required: [date-draft]
$ref: "#/$defs/name-and-anchor-name"
properties:
url:
description: |
The URL of the implementation's repository or documentation
type: string
format: uri
draft:
description: The supported drafts (up through draft-07)
type: array
items:
type: integer
enum: [1, 2, 3, 4, 6, 7]
date-draft:
description: The supported drafts (2019-09+)
type: array
items:
type: string
enum: [2019-09, 2020-12]
license:
description: |
The software license under which the implementation
is available
type: string
notes:
description: |
Additional information. Overly promotional (or critical)
wording should be avoided.
type: string
built-on:
description: |
Indicates that this implementation is built on another
implementation, typically to make it available through
a web page, CLI, or a different programming language.
type: object
$ref: "#/$defs/name-and-anchor-name"
compliance:
$ref: "#/$defs/compliance"
last-updated:
description: |
The date (in whatever timezone was relevant at the time)
the information for this entry was last updated. This
should only be changed when the implementation's
documentation has been checked against the entry, not
when minor formatting or other updates are done.
$comment: |
"pattern" does the validation work here, "format" is
just for semantic clarity.
type: string
format: date
pattern: '^\d\d\d\d-[01]\d-[0123]\d$'
compliance:
description: |
The compliance section notes aspects of an implementation's
_default configuration_ that are non-compliant with the
specification in ways that are _not necessarily_ detected
by the test suite. This information is provided based on
implementation documentation.
type: object
unevaluatedProperties: false
properties:
constraints:
description: |
A brief note of design constraints that impacted choices
regarding compliance. This includes things like
targeting memory-constrained environments, or trading
off features for performance. It does not include
opinions regarding the value (or lack thereof) of
the specification requirements.
type: string
config:
description: |
Documents how to configure an implementation to produce
the most specification-compliant behavior if it does
not do so by default. The resulting configuration
may still have incomplete compliance (such as not
having implemented all keywords), but will not
have additional behavior that contradicts the
specification (such as modifying the instance
by filling in default values).
type: object
unevaluatedProperties: false
required: [instructions]
properties:
docs:
description: |
A link to the implementation's configuration
documentation, ideally to whatever part addresses
configuration and compliance.
type: string
format: uri
instructions:
description: |
Instructions to configure for compliance. Will
appear in a sentence after "you must" and before
"to produce specification-compliant behavior."
type: string
Loading