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

Missing space between colon and value throws exception in case of flow mappings #291

Closed
fariadev22 opened this issue Nov 23, 2017 · 3 comments
Labels

Comments

@fariadev22
Copy link

#TestYaml
test:
  /{param}:
    type: {  collectionsTypes.mutableResource:{}}

The above YAML works fine in all other YAML parsers but not this one. I get the following exception:
(Line: 4, Col: 14, Idx: 42) - (Line: 4, Col: 46, Idx: 74): While scanning a plain scalar, find unexpected ':'.

This exception does not come if there is space between colon and the curly bracket:

    type: {  collectionsTypes.mutableResource: {}}

However, as per YAML 1.1 specification this is a case of flow mappings (http://www.yaml.org/spec/current.html#id2544175) which uses separation spacing (http://www.yaml.org/spec/current.html#id2521201) i.e. this spacing is optional. It should be ignored during parsing and a missing space should not throw an exception since it is not invalid.

@aaubry
Copy link
Owner

aaubry commented Sep 25, 2019

I'm sorry I was unable to answer this question in a timely fashion. As you have certainly moved on to other things, I will close this issue, but feel free to reopen it if necessary.

@aaubry aaubry closed this as completed Sep 25, 2019
@fariadev22
Copy link
Author

fariadev22 commented Sep 26, 2019

Hey @aaubry . The issue still exists and yes, I'd like to reopen it. Thanks

@aaubry aaubry reopened this Sep 26, 2019
@aaubry aaubry added the bug label Sep 26, 2019
@EdwardCooke
Copy link
Collaborator

This also fails in the reference parser. Therefore, I'm going with it's invalid YAML and that space is supposed to be there seeing as how it passes the reference parser when it's there.

http://ben-kiki.org/ypaste/data/66223/index.html

@EdwardCooke EdwardCooke closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants