github.com/mineiros-io/terradoc@v0.0.9-0.20220711062319-018bd4ae81f5/internal/schemas/varsschema/varsschema.go (about) 1 package varsschema 2 3 import "github.com/hashicorp/hcl/v2" 4 5 func RootSchema() *hcl.BodySchema { 6 return &hcl.BodySchema{ 7 Blocks: []hcl.BlockHeaderSchema{ 8 { 9 Type: "variable", 10 LabelNames: []string{"name"}, 11 }, 12 }, 13 } 14 } 15 16 func VariableSchema() *hcl.BodySchema { 17 return &hcl.BodySchema{ 18 Attributes: []hcl.AttributeSchema{ 19 { 20 Name: "type", 21 Required: true, 22 }, 23 }, 24 Blocks: []hcl.BlockHeaderSchema{ 25 { 26 Type: "validation", 27 LabelNames: []string{}, 28 }, 29 }, 30 } 31 }