Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decoder: Implement validateBody #287

Closed
8 tasks
dbanck opened this issue Jul 31, 2023 · 0 comments · Fixed by #294
Closed
8 tasks

decoder: Implement validateBody #287

dbanck opened this issue Jul 31, 2023 · 0 comments · Fixed by #294
Assignees
Labels
enhancement New feature or request

Comments

@dbanck
Copy link
Member

dbanck commented Jul 31, 2023

Requires #57

Problem Statement

Once we have the schema and the content for a file, we can use a combination of the two for validation.

Proposal

  • Implement validateBody
  • Raise diagnostics for the following cases
    • extraneous block labels - e.g. variable "one" "two" {
    • missing block labels - e.g. variable {}
    • unknown blocks (top level and within resources)
    • missing required attributes
    • unknown attributes
    • missing required blocks (with set minimum instances of block)
    • too many blocks (with set maximum instances of block)
    • deprecated attributes/blocks (warning)
  • Add test cases for all scenarios

User Experience

CleanShot 2023-07-31 at 11 44 52@2x CleanShot 2023-07-31 at 11 44 44@2x CleanShot 2023-07-31 at 11 45 04@2x CleanShot 2023-07-31 at 11 44 34@2x

Part of hashicorp/vscode-terraform#720

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants