Repository navigation
fix(schemas): correct Core metadata and generated API conformance - #574
marcschier wants to merge 25 commits into
Conversation
Isolate verified generator defects from federation review feedback. Add reproducible regressions and regenerate affected domain schemas. Fixes xregistry#573. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Restore the primer and CloudEvents schema artifacts to the PR baseline as requested in xregistry#571. Track future primer work in xregistry#572 and verified generator bugs in xregistry#573 with separate PR xregistry#574. Align the authored 1.0-rc1 draft status and tests and remove a stale TOC link and trailing whitespace. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Overlay Core Avro fields rather than duplicating them, share Meta declarations with structured deprecation, and allow ordinary Version metadata without inline document content. Add regressions and regenerate all affected released-domain artifacts for xregistry#574. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Define client/server hosting, local Resource shadowing, ordered source selection and diagrams. Move the portable document format beside its bindings, add binding motivations, remove crosswalks and legacy xregurl wording, and rewrite semicolon-delimited prose. Fix all four code-review defects with regressions. Keep all released schema artifact changes in xregistry#574 and out of xregistry#571. Leave review threads unresolved as requested. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Generate a distinct Version component even for maxversions=1, and use it for metadata-only Resource POST request and 201 response bodies. Keep Resource navigation out of Version metadata for declared and imported types without changing requiredness or document-bearing POSTs. Add 16 source-generator regression cases and regenerate the four affected released OpenAPI outputs. Preserve the prior Avro and Core metadata fixes. Fixes xregistry#573 Signed-off-by: Marc Schier <marcschier@hotmail.com>
|
Completed the two Version-reference residuals in the owner follow-up
Both regression groups failed before their respective fixes: eight cases each. $env:PYTHONDONTWRITEBYTECODE = "1"
$env:PYTEST_DISABLE_PLUGIN_AUTOLOAD = "1"
python -B -m pytest tools -q --tb=short `
-p no:cacheprovider -p pytest_asyncio.pluginThe installed asyncio plugin is loaded explicitly because autoload is disabled. |
Selected feedback addressed at
|
| Finding | Action taken |
|---|---|
574-S1 |
Restored modeled default-Version fields and wildcard values in the Avro and JSON Structure Resource projections, preserving separate record ownership and overlays. Resource copies remain optional for cross-references; Version requirements and present-value types remain enforced. |
574-S2 |
Admitted Resource documents without versions-navigation members while preserving nested-value checks and completed OpenAPI response requirements. |
F574-B1, F-FMT-1 |
Kept a short README compatibility warning, moved detailed changes to unreleased notes, and wrapped the affected prose. |
E-574-01 |
Clarified the historical verification head and the 83ef18a..2b23699 comparison; no general description rewrite. |
E-ALL-01 remains informational: no issue-state change was requested or made. JSON Structure evidence concerns the emitted contract, not full native SDK certification.
Behavioral evidence: test_avro_resource_record_round_trips_its_default_version_values, test_avro_resource_record_admits_a_cross_referenced_resource, test_schema_model_avro_resource_keeps_format_and_extensions, test_jsonstructure_resource_keeps_modelled_default_version_attributes, test_jsonstructure_resource_requires_nothing_a_cross_reference_omits, test_jsonschema_document_admits_resources_without_versions_navigation, test_openapi_resource_response_keeps_versions_navigation_requirement.
Current-head hosted verify and DCO passed. The PR remains unmerged.
The generated OpenAPI document routes advertised obsolete 'resource-*' wire header names and query parameters, a serialized 'resource-labels' aggregate, and no redirect, creation or non-JSON write contracts. Project the current Core HTTP metadata onto 'xRegistry-<SINGULAR>id', 'xRegistry-versionid' and the remaining scalar headers, using the Resource's effective singular for imported Resources and keeping Resource-level navigation out of Version serializations. Map attributes are described as a per-key header family, 'contenttype' stays on the native 'Content-Type' media contract, and document bytes, 'meta' and 'versions' are never headers. Document writes take the permitted metadata as optional header parameters instead of the removed 'resource-*' query carriers. Add the Core status and location contracts: GET and PUT answer 303 with Location and no document body, PUT answers 201 with the created entity's Location, creation and update responses carry Content-Location, and a content-bearing PUT success also offers the binary document media type. Metadata-only Resources gain the creation contract but are never redirected, and 'details' and 'meta' routes stay metadata-only. Location, Content-Location and Content-Disposition keep their native grammars. Remove the now unreferenced legacy components, regenerate the four affected OpenAPI artifacts, and add regressions over declared and imported Resources, singleton and multi-Version Resources, and raw JSON and binary documents. Refs: xregistry#721 Signed-off-by: Marc Schier <marcschier@hotmail.com>
Replace stale owning-array enum lookup with Core item.enum lookup for array/map values. Preserve strict/advisory behavior and owner-qualified Avro enums while retaining all existing Core metadata/API fixes. The real Endpoint regression failed for JSON Schema, OpenAPI and Avro before this change; all twelve strict/default/advisory cases and the complete tool suite now pass. Regenerate all sixteen artifacts from merged sources. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Merge accepted upstream model and HTTP-template corrections. Keep the Core-conformance generator and regenerate the conflicting Endpoint and CloudEvents Avro schemas from the current Endpoint model, including REQUIRED usage and the item enum. All 16 artifacts reproduce and 332 tools tests pass. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Incorporate the accepted pagination_noncollection error from upstream without changing this PR's proposals. Signed-off-by: Marc Schier <marcschier@hotmail.com>
| "type": "string", | ||
| "format": "uri", | ||
| "format": "uri-reference", | ||
| "pattern": "^/", |
There was a problem hiding this comment.
Removed the ^/ pattern from the shared XID mapping in schema-generator.py and regenerated the affected JSON Schema/OpenAPI artifacts in cdf15ad. This applies consistently to dataschemaxid and other emitted XID fields; it is not a manual edit to the generated file. The string type and URI-reference format remain.
| } | ||
| ] | ||
| } | ||
| }, |
There was a problem hiding this comment.
Why did you remove this and then add the opposite below?
There was a problem hiding this comment.
The property definition was moved to the enclosing properties object, not removed. The three positive required alternatives still select schema, schemabase64, or schemaurl. The added not alternative is the fourth, disjoint case: none of those fields is present.
The old schema required exactly one carrier and rejected metadata-only Versions. Core lines 3654–3667 say the embedded document fields do not appear by default and that at most one of the three carriers can appear. The new alternatives therefore allow zero or one, not the opposite requirement.
For example, {"format":"JSONSchema/draft-07"} now passes without an inlined document. Each single-carrier form still passes; all forms containing two or three carriers still fail. I checked all eight presence combinations against the actual before/after generated Version schemas. No additional change is needed for this point.
Merge accepted basemessage and Endpoint messagegroups target corrections. Resolve all generated-schema conflicts by regeneration from this branch generator and update the existing Avro assertion to the accepted basemessage name.16 artifact recipes reproduce;332 existing tools tests pass. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Signed-off-by: Marc Schier <marcschier@hotmail.com>
Signed-off-by: Marc Schier <marcschier@hotmail.com> # Conflicts: # cloudevents/schemas/document-schema.avsc # cloudevents/schemas/document-schema.json # cloudevents/schemas/openapi.json # endpoint/schemas/document-schema.avsc # endpoint/schemas/openapi.json # message/schemas/openapi.json # schema/schemas/document-schema.json # schema/schemas/openapi.json # tools/schema-generator.py
Signed-off-by: Marc Schier <marcschier@hotmail.com>
Signed-off-by: Marc Schier <marcschier@hotmail.com> # Conflicts: # cloudevents/schemas/document-schema.struct.json # endpoint/schemas/document-schema.struct.json # message/schemas/document-schema.struct.json # schema/schemas/document-schema.struct.json # tools/schema-generator.py
Signed-off-by: Marc Schier <marcschier@hotmail.com>
Current-main refresh
Merged
xregistry/spec:mainat8e8c6e0f12570efcc69782c8e9e672bc50ae727finc2485c92with DCO sign-off. This includes #725, #727, #728, #731, #732, #733 and #734.The refreshed emitters now read scalar array/map restrictions from
item.enum, matching the Endpoint source changed by #732. The real Endpoint test exposed missing restrictions in JSON Schema, OpenAPI and Avro before the repair. Default/strict and advisory cases now pass; owner-qualified Avro enums are preserved. All sixteen artifacts regenerate and independently reproduce; the complete tools suite passes 332 cases. Existing metadata, raw-document and generated API corrections remain separate from #724's broader validation work.The existing PR grouping is preserved. Earlier commit-specific results below are historical; current hosted checks apply to the refreshed head.
Fixes #573
Proposed Changes
Correct the released schema generator's Core metadata and generated API
contracts, independently of the federation work in #571.
The existing structured-array, metadata, timestamp, navigation and Version
addressing fixes remain.
The review follow-up fixes all nine reported defects:
outputs and raw document content. Ignore permitted Resource read-only
input fields without admitting them as Version output fields.
names, define structured wildcard records before referencing them, apply
Core overlays once, and generate Registry conditionals in the root namespace.
keep Meta controls out of unmodeled Version fields, and make inlined
model/capability slots objects rather than unconstrained values.
Head covered by the verification below:
2b23699.All changes are signed forward commits; the original history is retained.
Issue721 document-contract follow-up
Commit
f76f4f24additionally addresses the functional document/API contractsin #721 W04-c through W04-i. The real generator and OpenAPI
template now distinguish document metadata headers from legacy query
parameters; use
xRegistry-<effective singular>idand the other Core scalarheaders; expose map headers per key rather than as an aggregate; and keep native
Location,Content-LocationandContent-Dispositiongrammars separate fromalready-encoded private header values.
The generated operations distinguish 200 updates, 201 creation and body-free
303 redirects. Metadata-only routes do not gain document redirects. Document
PUT responses retain binary as well as domain JSON content, and Resource and
Version header contexts remain distinct.
The 54 added cases in
tools/test_schema_generator_regressions.pyexercisethe real generator, validate whole OpenAPI descriptions and cover imported
Resource types. They add no mock server, header-policy simulator or prose
assertions. At
f76f4f24, the complete tools suite passed 320 cases andall sixteen outputs independently reproduced.
docs/RELEASE_NOTES.mdrecordsthe related wire-contract changes. Structural schemas cannot prove native
header serialization or server concurrency behavior.
The separate Primer typo, W04-k, belongs to marcschier#1.
Complementary ProblemDetails, flag and metadata-input work remains in
#724; the lossless carrier proposal remains in #656.
These standalone results do not establish correctness of a later composition
of those independently evolving branches.
Earlier review verification (historical evidence)
For the earlier review-fix range
83ef18a..2b23699, the focusedgenerator/regression suite passed 168 cases and the full tools suite passed
211. All sixteen outputs independently reproduced. Relative to
83ef18a,twelve outputs changed and the four JSON Schema outputs stayed identical;
against
main(9ecf8ea), all sixteen outputs change. Source models andapplicable documentation/authoring checks passed.
A clean CI run exposed an undeclared optional URI-reference checker. The
follow-up declares
jsonschema[format-nongpl]and asserts checker registration,retaining all malformed-URI rejection checks. The generator and output bytes
are unchanged by that dependency correction.
For that head, hosted verify
and DCO passed.
The earlier unpublished composition with #722, #723 and
#724 passed 696 cases and reproduced all sixteen combined outputs.
That composition requires explicit source-level merge resolution; it is not a
claim of conflict-free merging.
Compatibility and Scope
Avro qualified names and repaired layouts can affect generated readers:
regenerate bindings and assess compatibility. JSON Structure evidence is
bounded emitted-contract and URI/object validation, not full native SDK
certification. The scalar profile in #656 is not adopted here.
Release Note