chore(schemas): migrate to JSON Schema 2020-12 - #112
Open
ucekmez wants to merge 1 commit into
Open
Conversation
Every schema declared `http://json-schema.org/draft-07/schema#`, while `@eep-dev/setup-cli` emits `openapi: "3.1.0"` documents that `$ref` those files. OpenAPI 3.1's schema dialect *is* JSON Schema 2020-12, so generated descriptions referenced draft-07 schemas from a 2020-12 context — a dialect mismatch that strict OpenAPI 3.1 tooling trips on, and one that the canonical `openapi.yaml` inherits. Migrating also unblocks the roadmap's "Schema → TypeScript / Pydantic codegen with a CI drift gate" item: most modern codegen targets 2020-12. The migration is mechanical and the tree was checked first for the keywords that actually changed: - `definitions` → `$defs` (8 occurrences) plus every `#/definitions/` pointer. This is the one that matters silently: a file left using the old keyword validates as an unknown annotation rather than failing, so its subschemas simply stop being reachable. - No array-form `items`, so no `prefixItems` conversion was needed. - No `dependencies` or `additionalItems`. - `exclusiveMinimum` already used the numeric form, which is unchanged. Ajv's default export only understands draft-07, so every validator construction moves to the `ajv/dist/2020` build — `tests/`, the benchmark suite, and the compliance CLI's schema registry. Assertions that pinned the old dialect are updated rather than deleted, and a new one pins that `definitions` and `#/definitions/` do not reappear. No property, constraint or `$id` changed, so every document that validated before still validates. Refs: EEP audit 2026-08 finding O6 Signed-off-by: Ugur Cekmez <ucekmez@gmail.com>
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 20 of a stacked series. Base is #111. Not for merge without review.
Every schema declared
http://json-schema.org/draft-07/schema#, while@eep-dev/setup-cliemitsopenapi: "3.1.0"documents that$refthose files.OpenAPI 3.1's schema dialect is JSON Schema 2020-12. So generated descriptions referenced draft-07 schemas from a 2020-12 context — a dialect mismatch strict OpenAPI 3.1 tooling trips on, and one the canonical
openapi.yamlfrom #109 inherits.Migrating also unblocks the roadmap's "Schema → TypeScript / Pydantic codegen with a CI drift gate" item: most modern codegen targets 2020-12.
The migration is mechanical — and I checked the tree first
Rather than assuming, I enumerated the keywords that actually differ between the dialects:
definitions$defs, plus every#/definitions/pointeritemsprefixItemsconversion neededdependenciesadditionalItemsexclusiveMinimumdefinitionsis the one that matters silently. A file left using the old keyword validates as an unknown annotation rather than failing — its subschemas just stop being reachable, with no error. There's a new test pinning that neither"definitions"nor#/definitions/reappears.Validator changes
Ajv's default export only understands draft-07, so every validator construction moves to the
ajv/dist/2020build:tests/test_schemas.test.ts,tests/conformance-fixtures.test.ts,tests/bench.test.ts@eep-dev/compliance-cli/src/schemas.tsAssertions that pinned the old dialect are updated rather than deleted — including the cross-impl Python one.
Scope
Checklist
$idchanged, so every document that validated before still validates. The$schemavalue changed on all 24 files, which downstream tooling pinned to draft-07 will notice — worth a CHANGELOG line. Consumers using Ajv will need theajv/dist/2020build, as this PR does internally.Verification
tests/@eep-dev/gates@eep-dev/middleware@eep-dev/compliance-cli@eep-dev/discovery@eep-dev/setup-clitests/cross-impl/compliance-cli --fixturescodegen-schema-types --checkcheck-draft-schema-parityopenapi-route-parityA repo-wide grep for
draft-07now returns only the explanatory comments about why theajv/dist/2020build is required.Notes for reviewers
This deliberately sits near the end of the stack. It churns all 24 schemas, so putting it earlier would have made every subsequent schema-touching PR rebase through a dialect migration. Everything that adds properties (#100, #106, #107, #110, #111) lands first.
$idvalues are untouched — they still readhttps://eep.dev/schemas/v0.1/…. Changing them would be a genuine break for anyone resolving schemas by$id, and the dialect change does not require it.Python side needs no change: nothing in the repo validates with
jsonschema; the Python fixture harness compares recorded outcomes rather than compiling schemas. Worth knowing if that changes.