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

YAML.parse() throws YAMLSemanticError when parse OpenAPI-Specification examples #108

Closed
arx-8 opened this issue May 2, 2019 · 2 comments

Comments

@arx-8
Copy link

arx-8 commented May 2, 2019

Thank you for creating an awesome package!

I got an error.
So, Can you fix this problem?

Overview

YAML.parse() throws YAMLSemanticError when parse OpenAPI-Specification examples

Reproducible example code

error-reproduction.zip

Reporter's environment

  • OS : Windows 7
  • node : v11.12.0
  • npm : 6.7.0
  • yaml : 1.5.0
  • js-yaml : 3.13.1 (For comparison)

Issue

YAML.parse() throws YAMLSemanticError.

Expected result

  • YAML.parse() throws no error.
  • YAML.parse() returns parsed Object.

Supplement

Other OpenAPI-Specification examples are working.
But, Only api-with-examples.yaml is not working...

Thank you and best regards,

@eemeli
Copy link
Owner

eemeli commented May 2, 2019

This is not a bug with yaml, but with the input file. The closing curly brace } on line 43 is indented by 17 spaces, but its opening brace { is on a line that has 18 spaces of indentation. The YAML spec requires that content within indented flow collections is indented by at least the same level. Admittedly js-yaml does not complain about this, but that's a mismatch between their implementation and the spec.

@arx-8
Copy link
Author

arx-8 commented May 3, 2019

@eemeli
Thank you very much for your explanations!
I understand it.

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