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: validateBody should support schema extensions #290

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

decoder: validateBody should support schema extensions #290

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

Comments

@dbanck
Copy link
Member

dbanck commented Jul 31, 2023

Requires #287

Problem Statement

In the work on functions & expressions we introduced the concept of extensions for handling count and for_each. Both aren't part of the regular attributes for a block, but are introduced by enabling the specific extensions for a block.

If the extensions are enabled for a block, we should not raise diagnostics for those attributes. If not, it's helpful to raise them.

Proposal

  • Update validateBody to include BodyExtensions when validating a file
  • When encountering an unknown attribute see if it's an attribute belonging to an extension AND the extension is enabled for that block
  • Support the following extensions
    • count
    • for_each
    • dynamic might just work™
  • Add test cases for each extension

Part of hashicorp/vscode-terraform#720

@dbanck dbanck added the enhancement New feature or request label Jul 31, 2023
@dbanck dbanck changed the title decoder: validateFilePerSchema support schema extensions decoder: validateBody should support schema extensions Aug 2, 2023
@jpogran jpogran linked a pull request Aug 9, 2023 that will close this issue
@radeksimko radeksimko linked a pull request Aug 10, 2023 that will close this issue
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