Skip to content

Retarget the normative JSON-Schema dialect from Draft 4 to 2020-12 #37

Description

@simontaurus

Problem

The spec declares Current support covers [Draft 4] (README L426), but it relies on constructs that are invalid under Draft 4:

  • $ref alongside sibling keywords. OO-LD places $ref next to type/properties/range/@context, and allOf: [{$ref: ...}] next to properties (Composition). This is only legal from JSON Schema 2019-09 onward. Core §8.2.3.1: "Note that this definition of how the results are determined means that other keywords can appear alongside of $ref in the same schema object." Under Draft 4/7 these siblings are ignored.
  • const (e.g. "type": {"const": "schema:Organization"}) was introduced in draft-06 and is not a Draft 4 keyword (Validation §6.1.3), so the current spec is internally inconsistent.

Resolution

  • Declare "$schema": "https://json-schema.org/draft/2020-12/schema" as the OO-LD base dialect; update README L426.
  • State that OO-LD composition requires 2019-09+ $ref-with-siblings semantics.
  • List Draft-4 idioms to avoid if present: definitions -> $defs, id -> $id, boolean exclusiveMinimum/exclusiveMaximum -> numeric.

Note (tooling reality)

Empirically, ajv 8 and json-editor 2.17.1 both evaluate const and $ref-siblings even under an explicit draft-07 $schema, so this is primarily a spec-correctness fix rather than a breakage fix.

Acceptance criteria

Source: gap analysis #18.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    M1Spec v1.0 ReleasedocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions