Add Resolved (JSON) button to JSON Schema tab#6
Open
smrgeoinfo wants to merge 1 commit into
Open
Conversation
Show a fully resolved, self-contained schema (all $ref inlined, allOf flattened) when the bblock has a resolvedSchema URL in register.json. Button is conditionally rendered only when the URL is present. - Add resolvedJson data state, computed, watcher in JsonSchemaViewer - Add resolvedSchema to COPY_PROPERTIES in bblock.service.js - Lazy-fetch on first click, with loading/error states Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
rob-metalinkage
left a comment
There was a problem hiding this comment.
Looks very useful - @avillar to consider the integration approach.
Initial testing is this works in https://www.jsonschemavalidator.net/ - and this will be really useful!
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
$refinlined andallOfflattened — no external referencesresolvedSchemaURL inregister.jsonMotivation
The existing "Full" schema views show the annotated schema from
build/annotated/, which still contains$refreferences to remote URLs. For building block authors and consumers who need a single self-contained JSON Schema (for local validation, JSON Forms integration, or tooling), a fully resolved view is valuable.The
resolvedSchemaURL is injected intoregister.jsonby a post-processing step (e.g., a script that resolves all$refand publishes the result alongside the building block sources). Repos that don't add this property are unaffected — the button simply won't appear.Changes
src/components/bblock/JsonSchemaViewer.vue(+46 lines):v-btnwithv-if="bblock?.resolvedSchema"guard and tooltipresolvedJsondata state (loading,contents,error)currentSchemaandcurrentSchemaLoadingcomputed property casesfetchDocumentByUrl()on first clickannotated/annotated-jsonmodes only (was previously shown for all non-source modes)src/services/bblock.service.js(+1 word):'resolvedSchema'toCOPY_PROPERTIESso the URL persists from the register entry throughfetchBBlock()Live demo
Direct link to a profile's JSON Schema view, where the Resolved (JSON) button appears alongside Source / Full (YAML) / Full (JSON):
https://cross-domain-interoperability-framework.github.io/metadataBuildingBlocks/viewer/bblock/cdif.bbr.metadata.profiles.cdifProfiles.CDIFDiscoveryProfile/json-schema
(Any building block with a
resolvedSchemain the register shows the button — e.g. the CDIF profiles or core types likeskosConcept.)🤖 Generated with Claude Code