Closed electriquo closed 11 months ago
What is the usage which causes this? I haven't been able to reproduce, so I suspect there's more to this than meets the eye.
I'd also be curious to hear what platform (Linux, macOS, Windows) and python version you're using, in case it's related.
@sirosen issue was updated with more details
I haven't been able to reproduce
@sirosen where you able to reproduce given all the (updated) details in the issue's description?
Yes; just this morning I found that I needed to use an input that would cause traversal of one of the problematic $ref
s, but that it is possible. I still haven't had enough free time to look into why this fails, but using
# example-pcc.yaml
repos:
- repo: https://github.com/sirosen/nosuchrepo
rev: 100
hooks:
- id: spam
types: [text]
then the following fails with the above error:
$ check-jsonschema --schemafile https://json.schemastore.org/pre-commit-config.json example-pcc.yaml
The key thing being that types: ...
is specified, which causes a lookup against another remote schema, which somehow fails.
I've tracked it down to a use of .raw
vs .content
from requests
. I'm still trying to decide if I'm embarrassed or not; but its a very simple mistake in the changes for this past release.
.raw
shows the verbatim response, even if it's gzipped or otherwise encoded.
.content
shows bytes after gzip inflation, etc.
Using the wrong one leads to a failing parse, but the underlying cause is a little bit inscrutable because of
referencing
(so the stack does not include the module which defined the callback)I've got the fix queued up and should be able to release it today.
I was just able to circle back on this and push it out as v0.24.1.
As always, just let me know if you see issues; and thanks for reporting this and providing all of the detail!
@sirosen 0.24.1 works now flawlessly
after upgrading from version 0.23.3 to version 0.24.0, jsonschema fails with
Failure resolving $ref within schema
, see belowthe execution is via pre-commit, here are more details: