stoplightio / vscode-spectral

VS Code extension bringing the awesome Spectral JSON/YAML linter with OpenAPI/AsyncAPI support

Home Page:https://marketplace.visualstudio.com/items?itemName=stoplight.spectral

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support customTags defined in vscode

suparngp opened this issue · comments

Describe the bug
I have the following section in my vscode to support AWS cloudformation tags and some other custom tags:

"yaml.customTags": [
    "!Equals sequence",
    "!FindInMap sequence",
    "!GetAtt",
    "!GetAZs",
    "!ImportValue",
    "!Join sequence",
    "!Ref",
    "!Select sequence",
    "!Split sequence",
    "!Sub",
    "tag:yaml.org,2002:bool"
  ]

My guess is that the last tag is supposed to be used as !!bool true so that the parsers always parse the value as a bool and not as a string. I had to add it because of a bug in parsing with serverless framework.

However, spectral doesn't seem to understand this and I get the following error

Cannot resolve a node with !<tag:yaml.org,2002:bool> explicit tagspectral(parser)

To Reproduce

  1. Given this OpenAPI document '...'
  2. Change this line to '....'
  3. See error

Expected behavior
Spectral should not complain about this kind of a tag.

Screenshots
Screen Shot 2020-10-15 at 10 00 55 PM

Environment:

  • Extension version: v0.2.4
  • VS Code version: latest
  • Operating System: MacOs Catalina