New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: schemafile could not be parsed as JSON #183
Comments
(Aside: It's not related to the core issue, but it's weird that the To understand your usage, I took a look at your config. Just to ensure we're on the same page, here's what you're running in - repo: https://github.com/sirosen/check-jsonschema
rev: 0.18.4
hooks:
- id: check-jsonschema
name: "Check GitHub Workflows"
files: ^\.github/workflows/
types: [yaml]
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
stages: [manual] That's a bit different from what I'm recommending these days, so I first want to make sure we're on the same page about the behaviors and that you're getting what you want and expect. Here's what I document for checking github workflows: - repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.19.1
hooks:
- id: check-github-workflows I don't mean to suggest that your config is wrong; it's just different. You'll always get the latest schema from schemastore (well, you should, the bug report is that you don't! 😅 ), whereas the All that aside, I can definitely do something to improve the download behavior. This is just a guess, but I've at least once seen schemastore respond with an empty 200.
|
Thanks @sirosen! I'm happy to update to the new recommended workflow. |
Awesome, glad I could offer a helping hand! I'm keeping this open though, since I still think that download behavior has room for improvement. |
Yep, sounds good. Here's the PR for anyone interested: jupyter-server/jupyter_server#1071. A nice benefit is that it can run in the |
First, add support to the cachedownloader for validation. A validation callback method can be passed to the cachedownloader on init, and will be used to test data and potentially retry before returning a result. The basic premise is that the validator should be a function which can raise a ValueError or a subclass thereof if the data downloaded doesn't meet our expectations (e.g. a partial download or empty data returned as a 200). Then apply this to the schema reader by passing `json.loads` as a validation callback. This will raise a JSONDecodeError on malformed data, triggering the retry. Add the appropriate note to the changelog. resolves #183
First, add support to the cachedownloader for validation. A validation callback method can be passed to the cachedownloader on init, and will be used to test data and potentially retry before returning a result. The basic premise is that the validator should be a function which can raise a ValueError or a subclass thereof if the data downloaded doesn't meet our expectations (e.g. a partial download or empty data returned as a 200). Then apply this to the schema reader by passing `json.loads` as a validation callback. This will raise a JSONDecodeError on malformed data, triggering the retry. Add the appropriate note to the changelog. resolves #183
First, add support to the cachedownloader for validation. A validation callback method can be passed to the cachedownloader on init, and will be used to test data and potentially retry before returning a result. The basic premise is that the validator should be a function which can raise a ValueError or a subclass thereof if the data downloaded doesn't meet our expectations (e.g. a partial download or empty data returned as a 200). Then apply this to the schema reader by passing `json.loads` as a validation callback. This will raise a JSONDecodeError on malformed data, triggering the retry. Add the appropriate note to the changelog. resolves #183
We occasionally see this error in CI, and it usually works when we kick the build.
Perhaps adding retry logic would address the issue.
The text was updated successfully, but these errors were encountered: