Incorrect type. Expected "string" when using a boolean value
See original GitHub issueOur YAML file begins as so:
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- README.md
This extension complains about the usage of batch: true
: Incorrect type. Expected “string”. The pipeline still works, and I worry that if I use "true"
instead of true
that it might be treated as a scalar value, in which case "false"
will still evaluate to true
.
Even the documentation shows an example of using the boolean value:
trigger:
batch: true
branches:
include:
- features/*
exclude:
- features/experimental/*
paths:
exclude:
- README.md
This is similar to issue #283 which has the intellisense incorrectly complaining about another part of the yaml.
Extension Version: v1.170.0
Version: 1.46.1 (user setup) Commit: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d Date: 2020-06-17T21:13:20.174Z Electron: 7.3.1 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.18363
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Incorrect type. Expected "string" · Issue #96 - GitHub
When writing ansible playbook, I get many reported problems where keys contain boolean values or integers... This seems that have started ...
Read more >flutter - yaml extension error ( Incorrect type. Expected "string ...
I'm having the same issue with VSCode since this afternoon, ... The YAML extension is using an incorrect schema to validate your YAML...
Read more >oc create with invalid yaml file syntax error misses line number
It appears that yaml (http://yaml.org/type/bool.html) does count "yes" and "no" as boolean values, and the resulting json would have that key-value pair ...
Read more >How to fix Error Invalid type. Expected Object but got Boolean.
Solved: How to fix Error Invalid type. Expected Object but got Boolean. Varible From Powerapp don't Send Boolean. Car_Management.
Read more >Azure Pipeline issues when using booleans with yaml templates
When I attempt to pass a boolean value as a parameter to a yaml template, ... it's still string default: bar - name:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not that I know of, unfortunately. It actually seems to be auto-generated, meaning that it’s even harder to fix than I thought 😢.
Okay, did some more digging. I’m pretty sure that for tasks, the schema is auto-generated from each task’s
task.json
file. So if you’re seeing problems with an individual task’s validation, go submit a PR to https://github.com/microsoft/azure-pipelines-tasks. Still don’t know how the rest of it (i.e.trigger
, etc) is generated though.