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

Getting a "Bad indendation in FLOWMAP" error #41

Open
pplu opened this issue Feb 9, 2021 · 3 comments
Open

Getting a "Bad indendation in FLOWMAP" error #41

pplu opened this issue Feb 9, 2021 · 3 comments
Labels

Comments

@pplu
Copy link
Contributor

pplu commented Feb 9, 2021

Hi,

I found this piece of CloudFormation that YAML::PP 0.026 doesn't parse, although Cloudformation considers it valid YAML:

Resources:
  Resource1:
    Properties:
      Item: {
        'accountId': { 'N': '15' },
        'username': { 'S': 'user' }
      }
  Resource2:
    Type: "XXX"

You get the following error:

Line      : 7
Column    : 7
Message   : Bad indendation in FLOWMAP
Where     : local/lib/perl5/YAML/PP/Parser.pm line 197
YAML      : "}"
  at local/lib/perl5/YAML/PP/Loader.pm line 94.

bug? not implemented yet? Or is there any parser / schema option that I'm not aware of?

@perlpunk
Copy link
Owner

perlpunk commented Feb 9, 2021

That is invalid YAML, but I'm aware that several parsers accept it.
Even the closing } is below the Item entry, and per definition any content below a certain key must be indented with at least one space.

See also https://www.yaml.info/learn/flowstyle.html

@pplu
Copy link
Contributor Author

pplu commented Feb 10, 2021

That is invalid YAML. but I'm aware that several parsers accept it.

Wow! One space fixed it all :)

It's kind of difficult to distinguish between invalid-but-accepted YAML and not-supported-yet-in-yaml-pp YAML. Sorry for overreporting.

Is there any way of getting YAML::PP to parse it via something in: https://metacpan.org/source/JLMARTIN/Cfn-0.13/lib/Cfn/YAML/Schema.pm

Would you accept a patch that enables the activation of such a "feature"?

@perlpunk
Copy link
Owner

perlpunk commented Apr 7, 2021

That has nothing to do with the Schema.
This would have to be implemented in the Lexer, and you can have a look at it if you want.

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

2 participants