Make the spec's own examples validate against osi-schema.json#209
Open
Pawansingh3889 wants to merge 1 commit into
Open
Make the spec's own examples validate against osi-schema.json#209Pawansingh3889 wants to merge 1 commit into
Pawansingh3889 wants to merge 1 commit into
Conversation
Four fixes, each aligning an example with a rule the schema already states: - The Semantic Model section example used datasets: [], violating the schema's minItems: 1; it now carries one minimal dataset. - Both metric examples (total_revenue, avg_orders) wrote expression as a bare list, omitting the required dialects wrapper that the Expression Object section above them defines; they now match the schema and the Complete Example. - The Complete Example presented a full document without the required top-level version key; it now begins with version: 0.2.0.dev0. - spec.yaml's commented primary_key examples showed a nested list (- [customer_id]) while the schema defines primary_key as a flat array of strings; the comments now show the flat form the schema and spec.md's own examples use. Verified by extracting each fixed example and running it through validation/validate.py (schema, uniqueness, references and sqlglot checks): all pass, including the Complete Example verbatim. Signed-off-by: Pawan Singh Kapkoti <42340841+Pawansingh3889@users.noreply.github.com>
jbonofre
approved these changes
Jul 17, 2026
jbonofre
left a comment
Member
There was a problem hiding this comment.
Good catch. @khush-bhatia ok for you?
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.
Four small fixes so the examples in core-spec agree with the rules osi-schema.json already states:
datasets: [], which violates the schema'sminItems: 1; it now carries one minimal dataset.total_revenue,avg_orders) wroteexpression:as a bare list, omitting the requireddialectswrapper that the Expression Object section directly above them defines. They now match the schema and the Complete Example.versionkey; it now begins withversion: 0.2.0.dev0.spec.yaml's commentedprimary_keyexamples showed a nested list (- [customer_id]) while the schema definesprimary_keyas a flat array of strings; the comments now show the flat form used by the schema and by spec.md's own inline examples.Verification: extracted each fixed example and ran it through
validation/validate.py(JSON Schema, name uniqueness, relationship references, sqlglot SQL checks) — all pass, including the Complete Example verbatim as a full document.Found while building an OSI exporter for a governed semantic-layer tool; happy to adjust scope if the section examples are intentionally fragments.