Comments (1)
You should be able to do this by mapping an arbitrary base URI to your schema directory, and assigning a URI to your 'main' schema. Something like the following:
from jschon import create_catalog, JSONSchema, URI
catalog = create_catalog('2020-12')
catalog.add_directory(URI('http://example.com/'), 'path/to/schemas')
main_schema = JSONSchema.loadf('path/to/schemas/main.json', uri=URI('http://example.com/main'))
So now any references are resolved with respect to your main schema's URI, which is based off a URI that is mapped to a directory.
from jschon.
Related Issues (20)
- "$schema" access should load a Metaschema like "$ref" access loads a JSONSchema HOT 1
- "$id" is (slightly) non-compliant (hidden by errors in JSON Schema Test Suite)
- Proposal: opt-in opinionated mode HOT 2
- Proposal: support a default source for URIs with no usable base URI vs relative-reference split
- Support instantiating mutually referencing schema bundles
- Proposal: Subschema iteration/recursion HOT 1
- Nitpick: "integer" is not a type that can restrict evaluation
- "instancePointer" incorrect in new-style ("hierarchical", "list") output HOT 3
- Proposal: Support for "default" values, output document with defaults, accept "default" values for "required" fields
- Support behavioral dependencies
- support draft-next "contains", "minContains", and "maxContains"
- support draft-next "propertyDependencies"
- jschon and OpenAPI support (surprisingly simple... probably) HOT 3
- Extensibility of [Relative]JSONPointer classes? HOT 8
- Meta-discussion: extensibility
- Immutable JSON? HOT 3
- Suggest type checking tool and configuration, and maybe add to tox?
- Down or upgrading JSON schema objects to different draft versions HOT 1
- Allow updating the default (URI prefix == None) Source
- 4 tests fail
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jschon.