Skip to content
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

Gives traceback on multi-document yaml files #4

Open
abentley opened this issue Jan 6, 2021 · 1 comment
Open

Gives traceback on multi-document yaml files #4

abentley opened this issue Jan 6, 2021 · 1 comment

Comments

@abentley
Copy link

abentley commented Jan 6, 2021

$ printf -- '---\na: b\n---'|yaml2jsonnet -
Traceback (most recent call last):
  File "/home/abentley/.local/bin/yaml2jsonnet", line 8, in <module>
    sys.exit(main())
  File "/home/abentley/.local/lib/python3.8/site-packages/yaml2jsonnet/cli.py", line 58, in main
    run(args)
  File "/home/abentley/.local/lib/python3.8/site-packages/yaml2jsonnet/cli.py", line 47, in run
    convert_yaml(yaml_data, args.out, args.document_comments)
  File "/home/abentley/.local/lib/python3.8/site-packages/yaml2jsonnet/yaml2jsonnet.py", line 14, in convert_yaml
    JsonnetRenderer(events, output, array, inject_comments).render()
  File "/home/abentley/.local/lib/python3.8/site-packages/yaml2jsonnet/jsonnet_renderer.py", line 210, in render
    self.state.send(event)
  File "/home/abentley/.local/lib/python3.8/site-packages/yaml2jsonnet/jsonnet_renderer.py", line 284, in _stream
    raise MultipleDocumentsError(self, event)
yaml2jsonnet.jsonnet_renderer.MultipleDocumentsError: Expecting a single document but got multiple: Last event was DocumentStartEvent(), the state was _stream, the queue was [(StreamStartEvent,_start)]

I think even "Expecting a single document but got multiple" without the rest would be fine.

@ghostsquad
Copy link

ya, it would be nice to just have this be returned as an array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants