You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.
<ParseException> Unable to parse. (line 10: '? /reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylong')
Expected behavior
This should succeed. The syntax in the input file is valid under the YAML spec but yamljs fails to parse it. The above input file is equivalent to
openapi: 3.0.2servers:
- url: "http://localhost:8080"description: localinfo:
title: testversion: 1.0.0description: testpaths:
/reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylong:
description: A descriptionget:
responses:
"200":
description: A descriptionoperationId: anOpIddescription: A description
Describe the bug
yamljs does not know how to parse some valid YAML documents
To Reproduce
With this as the input:
the following will fail:
Expected behavior
This should succeed. The syntax in the input file is valid under the YAML spec but
yamljs
fails to parse it. The above input file is equivalent tobut uses block mapping.
I believe the fix will just be to switch to a more fully-feature YAML parser. yamljs says development is slowed and recommends the use of js-yaml so it suggests that library ought to be used instead.
Screenshots
n/a
Desktop (please complete the following information):
Smartphone (please complete the following information):
n/a
Additional context
On very long lines, prettier switches to the block mapping style. I ran into this issue after following prettier/prettier#5599
A really simple demo of yamljs struggling with this syntax and js-yaml working:
Output:
The text was updated successfully, but these errors were encountered: