Resolve authoritativeDefinitions that reference another contract file - #1453
Open
simonharrer wants to merge 1 commit into
Open
Resolve authoritativeDefinitions that reference another contract file#1453simonharrer wants to merge 1 commit into
simonharrer wants to merge 1 commit into
Conversation
📖 Docs previewPreview site: https://brave-water-0cee36e03-1453.westeurope.7.azurestaticapps.net Changed pages (most-changed first):
|
A property can now link to a business definition kept in a file next to the contract, resolved relative to the referencing contract. This lets a technical contract own its physical shape while inheriting the business meaning from the same repository, with no server involved. Two shapes, both resolvable by every type: url: business.odcs.yaml#schema/orders/properties/order_id url: definitions/order_id.odcs.yaml With a fragment, the reference addresses one property inside another contract. Without one, the file *is* the definition and holds the property's elements directly -- a glossary as one file per term. The route is chosen by the url's shape, not by the link's type: a `#` fragment reads from disk, as does a fragment-less url naming a .yaml, .yml, or .json file; anything else keeps going through the existing lookup, so `url: /definitions/order_id` stays a path on the configured host. `businessDefinition` becomes a resolvable type alongside `semantics`, `semantic`, and `definition`, since the type says what a reference means and not whether it is a file or a URL. Fragments walk `schema/<schema>/properties/<property>`, matching on `id` first and falling back to `name`, and descend into nested properties and array items. Chains resolve transitively; a cycle between files is reported rather than followed.
simonharrer
force-pushed
the
feature/local-business-definition-references
branch
from
July 29, 2026 12:30
31d5059 to
0290d8f
Compare
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.
A property can now link to a property in another contract file, and the CLI resolves that link relative to the referencing contract before linting, testing, or exporting:
The technical contract keeps its own physical shape and inherits
businessName,description,examples, and everything else the business attribute defines. This covers the common layering of a business-level contract plus one technical contract per materialization, where both live in the same repository and no server is involved.How it works
#fragment on a non-HTTP url is read from disk; anything else keeps going through the existing lookup. So every resolvable type accepts either form.businessDefinitionis now a resolvable type, alongsidesemantics,semantic, anddefinition— the type says what a reference means, not whether it is a file or a URL. Precedence becomessemantics→semantic→definition→businessDefinition.schema/<schema>/properties/<property>, matching onidfirst and falling back toname, and descend into nestedpropertiesand arrayitems. A fragment must end at a property.id/name/authoritativeDefinitions/properties/itemsare never merged.Behaviour change
businessDefinitionlinks pointing at an HTTP URL were previously informational and triggered no request; they are now fetched likedefinitionlinks. A contract whosebusinessDefinitionpoints at something that is not an ODCS property document (a Confluence page, say) will now fail to resolve, and--no-inline-referencesis the escape hatch. Flagging it explicitly since it affects existing contracts.Also
examples/business-definitions/— an anonymized two-contract example, linted bylint_examples.pyin CI.docs/docs/semantics.md— a "Reference another contract file" section.tests/test_resolve_local_definitions.py— 20 tests covering resolution byidandname, nested properties and array items, relative paths, merge precedence, one-read-per-file, transitive chains, cycle detection, every failure mode, and--no-inline-references.Full suite passes; the s3/schema-evolution failures seen under
-n 8are testcontainer port contention and pass serially.test_duckdb_json.py::test_nested_jsonand thetest_test_mysql.pyimport error both fail onmaintoo.