question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect type. Expected "string" when using a boolean value

See original GitHub issue

Our 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:open
  • Created 3 years ago
  • Reactions:4
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
50Wliucommented, Aug 12, 2021

Not that I know of, unfortunately. It actually seems to be auto-generated, meaning that it’s even harder to fix than I thought 😢.

1reaction
50Wliucommented, Aug 16, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found