Repository navigation
Fixes #24149: upgrade JSON Schema from draft-07 to 2020-12 - #33631
Conversation
Move all 1024 schemas under openmetadata-spec to `https://json-schema.org/draft/2020-12/schema`, keeping `definitions` and every `#/definitions/...` pointer — 2020-12 tolerates them as unknown keywords and JSON Pointer resolution is unaffected. Two keywords the new dialect drops had to be handled: - `databasePolicyConfig.json` used `dependencies`, which 2020-12 replaced with `dependentRequired`. Left as-is it would silently stop enforcing "tableName requires schemaName" wherever a conformant validator runs. - 36 `"additionalItems": false` across 19 governance task schemas were removed. The keyword no longer exists in 2020-12 and was already inert: every site pairs it with schema-form `items`, where draft-07 ignores it too. Two consumers could not read the new dialect: - SchemaFieldExtractor loads schemas through everit-json-schema, which only knows meta-schemas up to draft-07 and failed with "could not determine version", taking the entity-fields and custom-property paths with it. Both loader sites now share newSchemaLoader(), which pins `.draftV7Support()`. The class walks schemas to list field names and types and never validates data, and our schemas use no keyword whose meaning differs between the drafts. - The UI validates every RJSF form with @rjsf/validator-ajv8, whose Ajv carries the draft-07 meta-schema only. Against a 2020-12 document it returns a single `no schema with key or ref ...` error and drops all field validation. JSONSchemaFormValidator builds validators from `ajv/dist/2020` instead, and all eleven import sites now go through it. `ajv` becomes a direct dependency at the range @rjsf/validator-ajv8 already resolves, so the two copies dedupe and yarn.lock is unchanged. The generators are unaffected: Java POJOs (1888 files), Pydantic models (1173 files) and the committed TypeScript types are byte-identical before and after. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
The only conflict was `.github/playwright/impact-map.generated.json`, which both sides had regenerated independently. Resolved by re-running `.github/scripts/generate_playwright_impact_map.py` against the merged tree rather than hand-merging generated JSON; the result is byte-identical to main's copy (798 entries) because this branch adds no spec-reachable source files. No other file was touched by both sides, and main introduced no new JSON schemas and no new `@rjsf/validator-ajv8` consumers, so the draft-07 -> 2020-12 upgrade needs no follow-up in the merged tree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ Playwright Results — workflow succeededValidated commit ✅ 4536 passed · ❌ 0 failed · 🟡 9 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 52m 10s ⏱️ Max setup 4m 41s · max shard execution 20m 59s · max shard-job elapsed before upload 24m 6s · reporting 19s 🌐 225.71 requests/attempt · 2.23 app boots/UI scenario · 45.51% common-shard skew Optimization targets still in progress:
🟡 9 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
…dles The Collate build vendors the OpenMetadata UI source into collate-ui but resolves against its own package.json, so the `ajv/dist/2020` import added here did not resolve there: [vite]: Rolldown failed to resolve import "ajv/dist/2020" from .../collate-ui/.../src/openmetadata-ui/src/utils/JSONSchemaFormValidator.ts Adding `ajv` to that package.json is not something this repo can do, so any new direct UI dependency is a cross-repo coordination cost. Reverted the dependency, the shared validator module and all eleven import swaps. Instead `parseSchemas.js` now strips `$schema` alongside the `$id` it already strips. What it writes is a dereferenced bundle, not the spec document it came from: the `$id` no longer addresses anything and the nested `$schema` keys are not even keyword positions. Removing the root declaration keeps Ajv on its default dialect, which is the dialect these forms have always been validated against, so behaviour is unchanged rather than merely equivalent. Also reverted `dependentRequired` back to `dependencies`. That conversion is correct for 2020-12 on paper, but Ajv's draft-07 build enforces `dependencies` and ignores `dependentRequired`, so it silently dropped "tableName requires schemaName" from the connector form. networknt honours `dependencies` under the 2020-12 dialect, so keeping it is the option that works in both validators today — the same backward-compatibility reasoning that keeps `definitions`. Verified: 1410 old-vs-new validations across all 282 generated bundles through the stock validator the app ships — 0 divergences, 0 compile failures (the one divergence before this revert was the lost dependency constraint). Generated POJOs still 1888 files / 0 diff, committed TS types unchanged, 409 UI tests pass across 36 suites. Teaching the UI to validate on an Ajv 2020-12 build is still the better end state; it needs the matching dependency in Collate, so it belongs in its own coordinated change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comments Outside DiffThese findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.
|
Conflicts were the three generated bundles under public/jsons and src/jsons (serviceConnection, testSuitePipeline, workflow): main changed the schemas behind them while this branch strips `$schema` from the generated output. Resolved by re-running `yarn parse-schema` over the merged spec rather than hand-merging generated JSON, so the result is what the generator produces and cannot drift from it. main also added `rillConnection.json`, a new connector schema still declaring draft-07. Flipped it to 2020-12 with the rest — a long-running dialect migration has to pick up whatever lands mid-flight or the tree ends up mixed. Scanned it first for the constructs that actually differ between the drafts (array-form `items`, `additionalItems`, `dependencies`, boolean `exclusiveMinimum`/`exclusiveMaximum`, `$ref` with sibling assertions): none present, so the flip is metadata-only for it too. Verified on the merged tree: spec builds with 1889 POJOs (+1 for main's new RillConnection); the committed TypeScript types are byte-identical to main, so this branch contributes no generated drift; 1415 old-vs-new validations across all 283 bundles through the stock @rjsf/validator-ajv8 show 0 divergences and 0 compile failures; 290 UI tests pass across 28 suites. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Code Review ✅ Approved 1 closed / 1 findings🔴 High risk · Broad JSON Schema dialect change affects backend and UI validation consumers Upgrades JSON Schema corpus from draft-07 to 2020-12 across 1,024 spec files and updates all consumers to handle the new dialect. Backend schema extraction pins draft-v7 compatibility mode (safe: schemas use no dialect-specific keywords), UI forms now validate through Ajv 2020, and generated bundles and scaffolding are regenerated to match. Comprehensive testing confirms validation behavior is preserved—1,410 comparisons show identical error sets—and all 198 connection-schema bundles validate without regression. No issues found. ✅ 1 closed✅ Quality: Inert dialect-mismatch assertion in validator test
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|
🚦 Removed from the merge queue —
|



Describe your changes:
Fixes #24149
Every JSON Schema under
openmetadata-specnow declareshttps://json-schema.org/draft/2020-12/schemainstead of draft-07.definitionsandall
#/definitions/...pointers are kept — 2020-12 toleratesdefinitionsas anunknown keyword and JSON Pointer resolution does not depend on it — so the schemas
themselves stay shape-compatible, exactly as the issue proposes.
The dialect bump is not purely cosmetic, though: 2020-12 deleted two keywords we use,
and two of our schema consumers cannot read the new dialect at all. Both are fixed here,
because without them the upgrade silently disables validation rather than failing loudly.
Type of change:
High-level design:
1. The schemas (1024 files).
$schema→ 2020-12. Nothing else changes; the specfiles keep
definitions,$id,javaType,$commentannotations and every$ref.2. Keywords 2020-12 removed.
metadataIngestion/policyagentconfig/databasePolicyConfig.jsondependenciesdependentRequireddependencies. Left alone, a conformant validator ignores it and "tableName requires schemaName" stops being enforced."additionalItems": falseitems, where draft-07 ignores it too.minItems/maxItemsalready carry the intent.I scanned the whole corpus for the other draft-07/2020-12 divergences before changing
anything — array-form
items(would needprefixItems), booleanexclusiveMinimum/exclusiveMaximum, draft-04id,$idwith a fragment,$id/$anchornested insidedefinitions, and$refwith sibling assertion keywords. There are zero occurrencesof any of them, which is why the two keywords above are the entire semantic delta.
3. Consumers that could not read 2020-12.
SchemaFieldExtractorloads entity schemas through everit-json-schema 1.14.4,which only ships meta-schemas up to draft-07 and aborts with
SchemaException: #: could not determine version. That takes down the entity-fields andcustom-property endpoints for every entity type. everit has no 2020-12 support and is
effectively unmaintained, so migrating it is not an option here; instead both loader
sites now share a
newSchemaLoader()helper that pins.draftV7Support(). That is safeand not a cop-out: this class walks a schema to enumerate field names and types and
never validates data, and per the scan above our schemas use no keyword whose meaning
differs between the two drafts. The comment on the helper records the reasoning.
The UI, which validates every RJSF form with
@rjsf/validator-ajv8. Its Ajv carriesthe draft-07 meta-schema only, and Ajv's failure mode here is quiet and total: against a
2020-12 document it returns the single error
no schema with key or ref "https://json-schema.org/draft/2020-12/schema"and validatesno field at all. Every connector form (198 of them), the SSO form, application config,
the profiler settings form and the ingestion workflow form would have been affected.
New
src/utils/JSONSchemaFormValidator.tsbuilds validators fromajv/dist/2020, andall eleven import sites now go through it instead of importing
@rjsf/validator-ajv8directly.
ajvbecomes a direct dependency pinned to^8.12.0— the exact range@rjsf/validator-ajv8already resolves — so the previously nested copy dedupes onto theroot one and
yarn.lockis unchanged.Alternative considered and rejected: stripping
$schemafrom the dereferenced bundlesin
parseSchemas.js(a one-line change, since the script already strips$id). It keepstoday's behaviour, but leaves the UI silently on draft-07 semantics while the spec claims
2020-12 — so the day someone adds a
prefixItemsordependentRequiredto a connectionschema, the form would mis-validate with no signal. Teaching Ajv the dialect is the
version that stays correct.
4. Propagation.
yarn parse-schemaregenerated the committed dereferenced bundles(
public/jsons/**,src/jsons/**); the hand-written application schemas, UI mocks andschema-shaped test fixtures were bumped to match; and
scaffold.pyplus the skills docsthat tell future authors which draft to use were updated so new schemas are born on 2020-12.
Deliberately left on draft-07: ingestion fixtures and the
TopicResourceITpayloadthat represent user-supplied topic/datalake schemas rather than OpenMetadata spec
documents, and
openmetadata-mcp/server.json(that$schemapoints at the MCP registryschema, not ours).
Backward compatibility / migration: none needed.
$schemais document metadata; nostored entity JSON changes shape, and the generated Java POJOs are byte-identical (see
below), so no
bootstrap/sqlmigration is involved.Tests:
Use cases covered
(migrations, type registry, search reindex).
GET /v1/metadata/types/fields/*and custom-property validation keep working throughSchemaFieldExtractor— this is the path that hard-failed before the everit fix.errors (required, enum, minLength, type) — this is the path that silently stopped
validating before the Ajv2020 fix.
networknt-validated paths) behave identically under the new dialect.
Unit tests
openmetadata-ui/src/main/resources/ui/src/utils/JSONSchemaFormValidator.test.ts(5 tests) as a regression guard for the exact failure mode: it asserts real field-level
errors come back for a 2020-12 document, that
$refintodefinitionsstill resolves,and that all 198 committed connection-schema bundles validate without the
no schema with key or refsentinel. RevertingAjvClass: Ajv2020makes 3 of the 5fail, with the bundle test listing all 198 — verified, not assumed.
Suites run:
openmetadata-serviceunit testspytest tests/unitCodegen was re-run and diffed rather than trusted — the schema change is metadata-only for
every generator:
mvn clean installboth sides)src/generated/**)I also ran an equivalence harness comparing old (draft-07 + stock Ajv) against new
(2020-12 + Ajv2020) across all 282 generated bundles plus the 10 application schemas,
on several form-data shapes: 1,410 comparisons, exactly 1 divergence — the intended
dependencies→dependentRequiredrename, which still produces the same"schemaName is required" error under the new keyword name.
Backend integration tests
9.3 testcontainers with a real server.
EntityShapeIT,SystemResourceIT,AppsResourceIT,WorkflowDefinitionResourceIT,ConversationSchemaMigrationITAll 4 failures across every suite are environmental or pre-existing, each verified rather
than assumed:
K8sOMJobOperatorIT,IngestionPipelineResourceITdocker run rancher/k3s:failed to evacuate root cgroup: read /sys/fs/cgroup/cgroup.procs: operation not supportedSearchIndexingFieldsParityITqueryCostRecordNPE (Query.setChangeDescriptionon aQuerydeleted by a concurrent test in the shared server). Passes when re-run in isolation.TaskWorkflowLifecycleResolverTest.workflowStartVariablesTolerateNullOptionalFieldsmaintree.task.json'spriorityis a bare$refwith nodefault, so the POJO field isnull, notMedium.test_airflow_connection.pyNo module named 'airflow'— airflow is deliberately excluded from theall-dev-envextra iningestion/setup.pyIngestion integration tests
ingestion/src/metadata/cli/scaffold.pyemits 2020-12 for newly scaffolded connection schemas and its unit test was updated with
it; the full ingestion unit suite is reported above.
Playwright (UI) tests
The regression risk here is "validation silently stops firing", which a browser test
covers far more slowly and less completely than the new Jest guard: that test walks all
198 connection-schema bundles in ~6s, where a Playwright spec would cover one connector.
playwright/e2e/Flow/ConnectionConfigLayout.spec.tsalready renders connector formsend-to-end and continues to apply unchanged.
Manual testing performed
mvn -pl openmetadata-integration-tests -am install -DskipTests)and booted the real stack via the IT harness — MySQL 8.3.0 + Elasticsearch 9.3.0
containers, migrations applied, Dropwizard app up — confirming the server loads and
registers all 58 entity types from the 2020-12 schemas.
make generate(exit 0),mvn clean install -pl openmetadata-spec,json2ts-generate-all.sh,yarn parse-schema.yarn parse-schemais stable after Prettier, so thetypescript-type-generationworkflow finds nothing to commit.yarn install --frozen-lockfilesucceeds against the newpackage.jsonwith nolockfile change; verified exactly one Ajv 8 copy remains in the tree and ESLint keeps
its own Ajv 6.
vite buildsucceeds andyarn bundle:checkpasses (1,045,603 bootstrapBrotli bytes against the 1150 KiB budget). Measured the Ajv2020 switch at +14.6 KB raw
/ ~3 KB gzipped on the validator chunk.
UI screen recording / screenshots:
Not applicable — this PR changes no markup, styling or layout. The UI delta is which Ajv
build backs the RJSF validator, and it is behaviour-preserving by construction: the 1,410
old-vs-new validation comparisons described above return identical error sets (same
messages, same properties, same counts) for every form in the product. A recording would
show two identical screens. Happy to attach one if a reviewer would still like it.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.$schemais documentmetadata, no stored entity JSON changes shape, and the generated POJOs are
byte-identical, so nothing in
bootstrap/sqlis affected.of a recording.
scaffold.pyand the connector-standards skills docsnow document 2020-12 for new schemas.
🤖 Generated with Claude Code
Open workspace in Conductor
No additional merge-blocking issue was found in the changes made since the previous review.
Summary
This PR updates OpenMetadata’s JSON Schema declarations from draft-07 to draft 2020-12 and adapts schema consumers that cannot directly load the new dialect.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR S[2020-12 source schemas] --> J[Generated Java/Python/TypeScript models] S --> E[SchemaFieldExtractor] E --> V7[Everit loader pinned to draft-07] S --> P[parseSchemas.js] P --> B[Dereferenced UI bundles without schema metadata] B --> R[RJSF forms using Ajv draft-07] S --> C[External 2020-12-aware consumers]Reviews (7) · Last reviewed commit: "Merge branch 'main' into copenhagen"