Shishqa / totosca

Apache License 2.0
1 stars 0 forks source link

More clear error message: "invalid map terminator" #25

Closed koppor closed 5 days ago

koppor commented 3 weeks ago

I am testing the tool with https://github.com/frankakn/cloud-native-deployment/tree/main/DeploymentOptions

$ toto check TeaStore-PaaS-Beanstalk.yaml
Error:
     ╭─[file:///C:/git-repositories/tosca/cloud-native-deployment/DeploymentOptions/TeaStore-PaaS-Beanstalk.yaml:193:20]
     │
 193 │       requirements:
     │                    ┬
     │                    ╰── invalid map terminator
─────╯
Error: "validation failed"

I checked https://docs.oasis-open.org/tosca/TOSCA/v2.0/csd06/TOSCA-v2.0-csd06.html#71-node-type, and I think, this is valid YAML, but I am not a YAML expert.

Shishqa commented 1 week ago

Hi! Thank you for the interest in totosca and sorry for the delayed reply

I was able to reproduce the bug by cloning the repository you provided: image

The error message originates in the yaml-peg-rs crate here, so I reported the issue https://github.com/KmolYuan/yaml-peg-rs/issues/14

To fix your issue you can enable auto whitespace trimming (e.g. in vscode https://stackoverflow.com/questions/30884131/remove-trailing-spaces-automatically-or-with-a-shortcut)

Shishqa commented 5 days ago

@koppor, The issue should be resolved now. Feel free to reopen this issue if not