aws-cloudformation / aws-cloudformation/cfn-lint-visual-studio-code

YAML Anchors and References Break Schema Validation and Suggestions

Open
#158 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
289
Forks
170
PR merge metrics
No merged PRs in 30d

Description

## Describe the bug
When user anchors or references in CloudFormation YAML files, schemas stops working when anchors/references are used.

Originally chased with `redhat.vscode-yaml` in https://github.com/redhat-developer/vscode-yaml/issues/425, but became clear the issue was being caused by this extension.

Since CloudFormation supports anchors and references through the `aws cloudformation package` path, would it make sense to fix the underlying issue?

## Expected Behavior
It works as normal.

## Current Behavior
Following error keeps repeating as elements are hovered.
```
Error thrown while requesting schema "Error: end of the stream or a document separator is expected" when calling the registered contributor "cloudformation"
```

## Steps to Reproduce

1. Add an anchor to any element
``` yaml
...
Tags: &tags
- Key: Application
Value: MyApp
...
```
## Environment
- [x] Windows
- [ ] Mac
- [ ] Linux
- [ ] other (please specify)

Contributor guide

Open the contributing guide

Research direction

Start at the registered "cloudformation" schema contributor and reproduce the repeated schema error with the YAML anchor example. Compare the behavior with redhat.vscode-yaml issue 425, then verify that CloudFormation schema validation and suggestions work normally for anchors and references without the error recurring.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, yaml
Domain
cloud, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.