<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.2
servers:
- url: "http://localhost:8080"
description: local
info:
title: test
version: 1.0.0
description: test
paths:
/reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylong:
description: A description
get:
responses:
"200":
description: A description
operationId: anOpId
description: 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 https://github.com/prettier/prettier/issues/5599
A really simple demo of yamljs struggling with this syntax and js-yaml working:
Output: