Skip to content

Commit

Permalink
Fix schema check by switching to http
Browse files Browse the repository at this point in the history
When using `https://cdn.jsdelivr.net/gh/Slicer/Slicer@main/Schemas/slicer-extension-catalog-entry-schema-v1.0.0.json` schema URL then the first schema check succeeded but subsequence checks failed with this error:

-----

Error: schemafile could not be parsed as JSON
SchemaParseError: https://cdn.jsdelivr.net/gh/Slicer/Slicer@main/Schemas/slicer-extension-catalog-entry-schema-v1.0.0.json
  in "/home/runner/.cache/pre-commit/repoh4psmzht/py_env-python3.9/lib/python3.9/site-packages/check_jsonschema/checker.py", line 53
  >>> return self._schema_loader.get_validator(

  caused by

  FailedFileLoadError: Failed to parse https://cdn.jsdelivr.net/gh/Slicer/Slicer@main/Schemas/slicer-extension-catalog-entry-schema-v1.0.0.json
    in "/home/runner/.cache/pre-commit/repoh4psmzht/py_env-python3.9/lib/python3.9/site-packages/check_jsonschema/schema_loader/readers.py", line 27
    >>> schema = callback()

    caused by

    JSONDecodeError: Expecting value: line 1 column 1 (char 0)
      in "/home/runner/.cache/pre-commit/repoh4psmzht/py_env-python3.9/lib/python3.9/site-packages/check_jsonschema/parsers/__init__.py", line 92
      >>> return loadfunc(data)

      caused by

      StopIteration: 0
        in "/opt/hostedtoolcache/Python/3.9.20/x64/lib/python3.9/json/decoder.py", line 353
        >>> obj, end = self.scan_once(s, idx)

-----

Switching to http://cdn.jsdelivr.net/gh/Slicer/Slicer@main/Schemas/slicer-extension-catalog-entry-schema-v1.0.0.json (http instead of https) seems to fix the problem.
  • Loading branch information
lassoan committed Nov 16, 2024
1 parent 3029804 commit ff7a1b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repos:
args:
[
"--schemafile",
"https://cdn.jsdelivr.net/gh/Slicer/Slicer@main/Schemas/slicer-extension-catalog-entry-schema-v1.0.0.json",
"http://cdn.jsdelivr.net/gh/Slicer/Slicer@main/Schemas/slicer-extension-catalog-entry-schema-v1.0.0.json",
]
- id: check-dependabot
- id: check-github-workflows

0 comments on commit ff7a1b1

Please sign in to comment.