Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Support yaml files with multiple documents

Open
#222 7 comments 15 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python, yaml
Domain
cli

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

enhancement needs-investigation

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)

Ref https://yaml.org/spec/1.2.2/#22-structures

Dominant language
Python
Stars
341
Forks
71
Avg merge
6d 13h
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-jsonschema/check-jsonschema

All issues in python-jsonschema/check-jsonschema

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.