Giter Club home page Giter Club logo

Comments (6)

santhosh-tekuri avatar santhosh-tekuri commented on May 14, 2024

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.

theory avatar theory commented on May 14, 2024

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.

santhosh-tekuri avatar santhosh-tekuri commented on May 14, 2024

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.

theory avatar theory commented on May 14, 2024

It's both instance-location and schema-location:

  1. 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.
  2. 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.

santhosh-tekuri avatar santhosh-tekuri commented on May 14, 2024

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.

theory avatar theory commented on May 14, 2024

Will do, see what I figure out, may come back with a PR or two. Thanks

from jsonschema.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.