Skip to content

Commit

Permalink
schemahelper: Make dynamic block content block required (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored Sep 5, 2023
1 parent 49d1594 commit 992cdde
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion decoder/body_extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1900,7 +1900,7 @@ resource "aws_elastic_beanstalk_environment" "example" {
Value: "The body of each generated block",
Kind: lang.PlainTextKind,
},
Detail: "Block, max: 1",
Detail: "Block, min: 1, max: 1",
Kind: lang.BlockCandidateKind,
TextEdit: lang.TextEdit{
Range: hcl.Range{
Expand Down
2 changes: 1 addition & 1 deletion decoder/hover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ func TestDecoder_HoverAtPos_extensions_dynamic(t *testing.T) {
hcl.Pos{Line: 5, Column: 13, Byte: 102},
&lang.HoverData{
Content: lang.MarkupContent{
Value: "**content** _Block, max: 1_\n\n" +
Value: "**content** _Block, min: 1, max: 1_\n\n" +
"The body of each generated block",
Kind: lang.MarkdownKind,
},
Expand Down
1 change: 1 addition & 0 deletions decoder/internal/schemahelper/dynamic_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func buildDynamicBlockSchema(inputSchema *schema.BodySchema) *schema.BlockSchema
Blocks: map[string]*schema.BlockSchema{
"content": {
Description: lang.PlainText("The body of each generated block"),
MinItems: 1,
MaxItems: 1,
Body: block.Body.Copy(),
},
Expand Down

0 comments on commit 992cdde

Please sign in to comment.