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)
- Provide CLI binaries with release HOT 3
- 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 6
- Feature: Adding Context to Validate Method HOT 2
- implementing json.Marshaler interface HOT 9
- Create JSONSchema from Compile()'s result HOT 2
- Wrong unevaluatedProperties validation errors HOT 6
- compiler.go bug in 171
- Invalid JSON schema does not error out HOT 2
- [bug] Not reading from stdin HOT 2
- Missing document file path in validation output when validating multiple documents HOT 5
- Error messages are revealing absolute file paths HOT 1
- YouValidateMe JSON Schema library server project built on this library
- ECMA-262 as the default regex in this library? HOT 1
- jsonschema.Compiler has no field or method CompileRegex HOT 7
- Question: parsing Schema to string HOT 1
- error is missing instanceLocation HOT 1
- Cannot install older version than `@latest` HOT 3
- The latest release doesn't build HOT 2
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.