Support yaml files with multiple documents
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by tracing the file-loading path through instance_loader.py and parsers/init.py, which appear in the reported traceback. Run the supplied check-jsonschema command with the example catalog-info.yaml, then inspect how YAML is currently parsed. Done means multi-document YAML files can be checked without the single-document parse failure, with the relevant behavior covered by tests.
Written by the indexing model from the issue text.
Description
Is there any interest in adding support for checking yaml files with multiple documents in them? That is:
catalog-info.yaml:
---
apiVersion: backstage.io/v1alpha1
kind: System
metadata:
name: example-system
spec:
owner: my-team
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: example-service
spec:
owner: my-team
system: example-system
❯ check-jsonschema --schemafile "https://json.schemastore.org/catalog-info.json" -v catalog-info.yaml
Several files failed to parse.
FailedFileLoadError: Failed to parse catalog-info.yaml
in "/Users/nikolark/.pyenv/versions/3.10.8/lib/python3.10/site-packages/check_jsonschema/instance_loader.py", line 31
>>> data: t.Any = self._parsers.parse_file(path, self._default_filetype)
caused by
ComposerError: expected a single document in the stream
in "<byte string>", line 2, column 1:
apiVersion: backstage.io/v1alpha1
^ (line: 2)
but found another document
in "<byte string>", line 8, column 1:
---
^ (line: 8)
in "/Users/nikolark/.pyenv/versions/3.10.8/lib/python3.10/site-packages/check_jsonschema/parsers/__init__.py", line 89
>>> return loadfunc(fp)
- Dominant language
- Python
- Stars
- 341
- Forks
- 71
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 6
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-jsonschema/check-jsonschema
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
python-jsonschema/check-jsonschema#702 ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
python-jsonschema/check-jsonschema#680 ·
Maintainers usually reply within 3 days
-
Support ETag for cache validation when Last-Modified is unavailableMay be free again @sirosen claimed this 186 days ago, and no pull request is open. Openenhancement
python-jsonschema/check-jsonschema#668 · 9 comments · 1 assignee ·
Maintainers usually reply within 3 days
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
python-jsonschema/check-jsonschema#663 ·
Maintainers usually reply within 3 days
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
python-jsonschema/check-jsonschema#655 · 1 reaction ·
Maintainers usually reply within 3 days
All issues in python-jsonschema/check-jsonschema
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
qgis/QGIS-Plugins-Website#459 ·
-
bug severity:medium
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
bot-found bug priority: P3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
madenvel/KalinkaPlayer#179 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ls1intum/edutelligence#1098 ·
Maintainers usually reply within 1 day