Comments (6)
the schema stack in CompilerConetxt is implementation detail and may change in future, so it is not wise to access it.
what kind of extension you are trying to implement ?
may be i can help if i know the details...
from jsonschema.
The extension identifies properties that should be indexed. In my app, I'd like to get the full path to each property so I can extract it via a JSONPath query to index. So once I've compiled a schema, I'd like to get those paths from the schema (and any of its sub-schemas).
from jsonschema.
from your comment, it looks like your extension is similar to keyword required
.
also i notice that, you are trying to use jsonschema as a configuration file containing the properties to be indexed. the validator is not meant for this purpose. i.e you are trying to extract some information from schema and trying to use it post-validation.
i suggest to rethink your usecase.
also i think what you need is the instance-location not schema-location. can you provide sample examples demonstrating your extension usage.
from jsonschema.
It's both instance-location and schema-location:
- When the schema is compiled, I want to look at it to see which paths are defined to be indexed, so I can create the necessary indexes.
- After the schema has validated a JSON object, I want to use the data from the schema to pull out the values to include in the index when I add it to the database.
So yes, I want to have the information necessary from the schema, and will use it after validation, but the validator will be unaffected.
from jsonschema.
I am not convinced of your use case.
I feel it is not appropriate to expose these internals. I suggest to clone this project and modify as per your requirements.
from jsonschema.
Will do, see what I figure out, may come back with a PR or two. Thanks
from jsonschema.
Related Issues (20)
- Getting property name when compiling and validating user-defined keyword via extensions HOT 5
- Feature request: Pass custom compiler into "convenience" functions like CompileString HOT 2
- Performance drop when schema has "uniqueItems" set to true HOT 7
- `format` field of json schemas is not being validated HOT 1
- CompileString - stat .: permission denied HOT 1
- How can I validate to Python re flavor regex? HOT 4
- Proposal: Add Method to Generate Go Types from JSON Schema HOT 1
- Error when loading valid draft7 json schema HOT 2
- Validating json with json-schema HOT 4
- Draft2020 accepts invalid email address. HOT 5
- Support for $defs and definition keyword in Schema object. HOT 3
- ReadOnly and WriteOnly are getting ignored HOT 7
- i18n support
- Detailed output missing info
- Compiling a subresource with an extension validates the subresource against the root extension schema. HOT 6
- unexpected validation error which LSP is fine with HOT 10
- Provide CLI binaries with release HOT 2
- Link in README for YAML playground example is broken HOT 1
- Issue with custom Regex Library HOT 10
- `Compiler.AddResource` for adding pre-compiled schemas HOT 5
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 jsonschema.