You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enhancement request: provide specific documentation on how to make schema validation use only local files #1308
I want to make Schema validation use only local files on the filesystem, even if the "$id" field has an HTTP URL. (So that my script doesn't continuously hit the website.) I can't figure out how to do that based on the current documentation. My request is that you include documentation about how to perform this specific type of usage.
(Note: local-file-only validation works for me with check-jsonschema --base-uri ., but because the check-jsonschema code is too object-oriented and complicated, I can't figure out how to do the same thing with just.
Also note: ChatGPT has absorbed only the older RefResolver approach, which gives a deprecation warning. (Probably from places like StackOverflow where old reference to that from 2019 are the top hit.). And it's not able to figure out / help me with doing this the right way either.)
Hi there -- within this library, or as far as referencing.Registry is concerned, nothing will make an HTTP request unless you yourself have done so, so there's not much to document. It's possible you're using something downstream of this library where you're making HTTP requests, e.g. the jsonschema library will do so for backwards compatibility reasons until version 5 is released, but will emit a warning if you rely on this behavior (and it sounds like you're using check-jsonschema, so you may want to consult there instead.
Hello and thanks for the quick reply. I was specifically using jsonschemavalidate() in my own python script. I was concerned that if I filed this ticket against jsonschema it would be said that the correct solution is to use referencing since that's what the deprecation warning says. I only mention check-jsonschema because it's an example of having something that documents how to stop network lookup. Should this instead be re-filed as a documentation request against jsonschema?
Got it, then the docs you should have a look at are here -- specifically as long as you provide your own referencing.Registry, no HTTP requests are made -- that's specifically called out at the bottom here.
Activity
Julian commentedon Oct 23, 2024
Hi there -- within this library, or as far as
referencing.Registryis concerned, nothing will make an HTTP request unless you yourself have done so, so there's not much to document. It's possible you're using something downstream of this library where you're making HTTP requests, e.g. thejsonschemalibrary will do so for backwards compatibility reasons until version 5 is released, but will emit a warning if you rely on this behavior (and it sounds like you're usingcheck-jsonschema, so you may want to consult there instead.rohan0rtiz0 commentedon Oct 23, 2024
Hello and thanks for the quick reply. I was specifically using
jsonschemavalidate()in my own python script. I was concerned that if I filed this ticket againstjsonschemait would be said that the correct solution is to usereferencingsince that's what the deprecation warning says. I only mentioncheck-jsonschemabecause it's an example of having something that documents how to stop network lookup. Should this instead be re-filed as a documentation request againstjsonschema?Julian commentedon Oct 23, 2024
Got it, then the docs you should have a look at are here -- specifically as long as you provide your own
referencing.Registry, no HTTP requests are made -- that's specifically called out at the bottom here.