Help us shape the future of Go! Take the 2026 Go Developer Survey

sdkv2schema

package
v1.83.36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package sdkv2schema contains compatibility helpers for mirroring SDKv2 provider schema semantics in terraform-plugin-framework schemas.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StringAttributeWithEnvDefault

type StringAttributeWithEnvDefault struct {
	EnvName string
	schema.StringAttribute
}

StringAttributeWithEnvDefault mirrors an SDKv2 required string field using schema.EnvDefaultFunc(envName, nil).

SDKv2 does not serialize DefaultFunc itself into the protocol schema, but during schema conversion it treats a Required field with a non-nil default value as Optional. schema.EnvDefaultFunc only returns a non-nil default when the environment variable is non-empty, so this attribute makes the same runtime Required/Optional decision.

The embedded schema.StringAttribute carries the standard framework string attribute metadata. Its Required/Optional fields are intentionally ignored; this wrapper owns those two protocol flags.

func (StringAttributeWithEnvDefault) IsOptional

func (a StringAttributeWithEnvDefault) IsOptional() bool

IsOptional returns true when the SDKv2 EnvDefaultFunc would provide a default value, matching SDKv2's protocol schema conversion behavior.

func (StringAttributeWithEnvDefault) IsRequired

func (a StringAttributeWithEnvDefault) IsRequired() bool

IsRequired returns true when the SDKv2 EnvDefaultFunc would not provide a default value, matching SDKv2's protocol schema conversion behavior.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL