Comments (4)
Thanks for the info; this lets me see the same error.
I also confirmed that this is an issue specific to the schemastore prometheus schema. I was able to create a scenario analogous to yours in which a ref to a known-valid schemastore schema (the github workflows one) works correctly.
I'm 99% certain at this point that it's just the fact that the prometheus schema has a bad $id
field.
I'll use this scenario to work on improving the error reporting in check-jsonschema
and then file an upstream issue.
from check-jsonschema.
I've just pushed a commit to main
which makes the error in this case clearer, as it traverses and prints some of the most relevant info from chained exceptions on ref resolution errors.
Example output:
$ check-jsonschema --schemafile schema.json values.yaml
Failure resolving $ref within schema
RefResolutionError: HTTP Error 404: Not Found
in "/home/sirosen/projects/check-jsonschema/src/check_jsonschema/checker.py", line 99
>>> errors = self._build_error_map(validator, instances)
caused by
HTTPError: HTTP Error 404: Not Found
in "/home/sirosen/projects/check-jsonschema/.venv/lib/python3.8/site-packages/jsonschema/validators.py", line 777
>>> document = self.resolve_remote(url)
caused by
KeyError: 'https://json.schemastore.org/prometheus.rules'
in "/home/sirosen/projects/check-jsonschema/.venv/lib/python3.8/site-packages/jsonschema/validators.py", line 774
>>> document = self.store[url]
I also confirmed that the sample content passes the prometheus schema if it is corrected to have an accurate $id
.
I'm retitling the issue, as there is no relevant bug in check-jsonschema
or the underlying jsonschema
library.
from check-jsonschema.
I've opened an issue upstream, SchemaStore/schemastore#1928
With that and improved error handling in place within check-jsonschema
, there's nothing more to be done here. I'm closing; tracking can continue on the upstream issue.
from check-jsonschema.
Thanks @sirosen!
from check-jsonschema.
Related Issues (20)
- Support for `default.json` for `renovate` HOT 6
- Allow validating YAML with inline yaml-language-server comments HOT 2
- Allow optionally interpreting .json files as JSON5 HOT 4
- Failure resolving ref to anchor within same schema after v0.24.0 HOT 5
- Support new GitHub Actions Runner Scale Sets HOT 2
- Opening concurrent file handles for all instancefiles risks breaching OS limit. HOT 6
- Support ECMAScript unicode-mode RegExp usage for 'pattern' and 'patternProperties' HOT 3
- [BUG] `github-workflows-require-timeout.json`: `timeout-minutes` should allow expressions HOT 4
- Feature request: add line numbers to the output HOT 3
- Update vendored bitbucket schema HOT 1
- Feature request: add file names to the ouptut even if validation is OK HOT 3
- "unexpected keyword argument 'registry'" when validating specific GitHub workflow HOT 4
- Bug: Globs work in my machine but fails on CI HOT 3
- AttributeError not parsing schema correctly. HOT 2
- Cannot validate date-time via the CLI tool HOT 4
- Distribute the check-jsonschema tool in a manner which does not assume a Python environment
- Validation passes for misspelled optional child properties in Google Cloud Build schema HOT 7
- check-gitlab-ci: coverage is not a regex HOT 9
- Check yaml with check-metaschema option HOT 3
- Non-JSON files ignored despite --default-type being set HOT 4
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 check-jsonschema.