Comments (3)
Another wrinkle is that usually when I use this source I don't care about associating it with a base URI — I just want it to work for everything, which is not supported by the current Source
interface. And having an InMemorySource
like this essentially serves as a manually populated cache for the catalog's automatically managed cache. So perhaps a public interface to load schemas directly into the catalog would be a better option? This would be distinct from Catalog.add_schema()
. [EDIT: Or if it's Ok for end users to use Catalog.add_schema()
I could just make a documentation/tutorial PR about that?]
I'm not sure what the best design is here, I just know that it's my most common use case and feels like it involves too much boilerplate for something that's technically even more straightforward than the two supported sources.
from jschon.
OK so in the end all that happened here is that I assumed that since there was a tutorial for reference resolution that talked about Source
s, that I needed a source even for an in-memory thing.
Of course this is not true, just instantiating a JSONSchema
object caches it in the relevant catalog. I'll look at the documentation and see if I think there's a way to make this a bit more clear for the workflow of pre-populating the catalog with all relevant schemas.
As usual with jshcon
, in the end there is much less of a problem and a much easier solution than I initially feared. 😅 😁
from jschon.
...and I still don't know what I'm talking about. I'm going to close this, and when I'm absolutely sure I know what I mean I will file an issue grounded in actual use cases and passing/failing tests.
from jschon.
Related Issues (20)
- 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
- "$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
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.