// Copyright IBM Corp. 2020, 2026
// SPDX-License-Identifier: MPL-2.0

package schema

import (
	"github.com/hashicorp/go-version"
	"github.com/hashicorp/hcl-lang/schema"

	v1_14_mod "github.com/hashicorp/terraform-schema/internal/schema/1.14"
)

func ModuleSchema(v *version.Version) *schema.BodySchema {
	bs := v1_14_mod.ModuleSchema(v)

	bs.Blocks["variable"] = patchVariableBlockSchema(bs.Blocks["variable"])
	bs.Blocks["output"] = patchOutputBlockSchema(bs.Blocks["output"])
	bs.Blocks["module"] = patchModuleBlockSchema(bs.Blocks["module"])

	return bs
}
