-
Notifications
You must be signed in to change notification settings - Fork 78
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
Consider moving from js-yaml to yaml module #243
Comments
Edit: comment moved to #249 |
I'll do this when #250 is finished (adding better testing to the command files). |
@MikeRalphson yoou mentioned working on the yaml module, but you meant the yaml package right? Not changing |
Yes, on |
Clear, I'll have a look at that in the next few days |
Okay, few days became this hour ;-) |
I lost track of the status of this, is it now possible to get proper line numbers on errors when validating yaml? Today I found some issues with yaml comments, and it seems the latest master doesn't still include this functionality. |
Line/column locations should be available in |
Ok, I see that #267 is still open, and uses 1.2. @philsturgeon @MikeRalphson How easy would be to integrate 1.3 and modify the error reporting to get meaningful reports? I'm not familiar with that part of the code (I'm not even sure if this would need to be modified in oas-kit). |
This has been addressed in v0.10.0 |
Detailed description
js-yaml
has some bugs related to the YAML 1.2 specification, in that it appears to convert strings which contain only digits and begin with a 0 into octal integers when it should not. This may only be the case where the{json:true}
option has been provided. It also seems to drop seconds/fractions of a second from date-time string properties.The yaml module is tested against the official
yaml-test-suite
and is smaller (not including theesprima
engine). It has far fewer open issues (but may be much less utilised in the wild so far). It also has the ability to build an abstract-syntax-tree or concrete-syntax-tree built in. It will also hopefully be gaining some nice features such as:(if my PRs are accepted).
Context
oas-kit
is going to migrate sonode_modules
de-duplication will result in an even smaller installed size. This will probably be a breaking change inoas-kit
(all version numbers bumped by a major revision).Possible implementation
Replace
js-yaml
withyaml
,safeLoad
withparse
,safeDump
withstringify
.Your environment
all
More...
This issue is a heads-up really. But I'm happy to PR the changes.
The text was updated successfully, but these errors were encountered: