web scraping – How to fix mapping values are not allowed in this context error in yaml file?

web scraping – How to fix mapping values are not allowed in this context error in yaml file?

You cannot have a multiline plain scalar, such as your include:false transitions be the key to a mapping, that is why you get the mapping values not allowed in this context error.

Either you forgot that you have to have a space after the value indicator (:), and you meant to do:

        include: false
        transitions:

or you need to quote your multi-line scalar:

        include:false
        transitions:

or you need to put that plain scalar on one line:

        include:false transitions:

please note that some libraries do not allow value indicators in a plain scalar at all, even if they are not followed by space

we need to use space before :
Then it will excecute
check the yaml script in below
http://www.yamllint.com/

web scraping – How to fix mapping values are not allowed in this context error in yaml file?

There are couple of issues in the yaml file, with yaml files it gets messy, fortunately it can be identified easily with tools like yaml lint

Install it

npm install -g yaml-lint

Here is how you can validate

E:githubReposprometheus-sql-exporter-usageetc>yamllint prometheus.yaml
√ YAML Lint successful.

Leave a Reply

Your email address will not be published.