From 725ea594e9e814429719995033b6f28c5928c605 Mon Sep 17 00:00:00 2001 From: Venelin Date: Wed, 3 Jul 2024 12:36:17 +0100 Subject: [PATCH] diff tests for sdkv2 --- go.mod | 5 +- go.sum | 4 +- pkg/tests/go.mod | 2 + pkg/tests/go.sum | 1 + pkg/tests/schemaconvert/schemaconvert.go | 130 ++++ pkg/tfbridge/diff_test.go | 775 +++++++++++------------ 6 files changed, 521 insertions(+), 396 deletions(-) create mode 100644 pkg/tests/schemaconvert/schemaconvert.go diff --git a/go.mod b/go.mod index f80338fb2..9ce42f612 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,8 @@ go 1.21 replace github.com/pulumi/pulumi-terraform-bridge/x/muxer => ./x/muxer +replace github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tests => ./pkg/tests + require ( github.com/apparentlymart/go-cidr v1.1.0 github.com/blang/semver v3.5.1+incompatible @@ -36,8 +38,9 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 github.com/pkg/errors v0.9.1 github.com/pulumi/inflector v0.1.1 - github.com/pulumi/providertest v0.0.11 + github.com/pulumi/providertest v0.0.13 github.com/pulumi/pulumi-java/pkg v0.11.0 + github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tests v0.0.0-00010101000000-000000000000 github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.8 github.com/pulumi/pulumi-yaml v1.8.0 github.com/pulumi/schema-tools v0.1.2 diff --git a/go.sum b/go.sum index f07714892..d8910077d 100644 --- a/go.sum +++ b/go.sum @@ -1901,8 +1901,8 @@ github.com/pulumi/esc v0.9.1 h1:HH5eEv8sgyxSpY5a8yePyqFXzA8cvBvapfH8457+mIs= github.com/pulumi/esc v0.9.1/go.mod h1:oEJ6bOsjYlQUpjf70GiX+CXn3VBmpwFDxUTlmtUN84c= github.com/pulumi/inflector v0.1.1 h1:dvlxlWtXwOJTUUtcYDvwnl6Mpg33prhK+7mzeF+SobA= github.com/pulumi/inflector v0.1.1/go.mod h1:HUFCjcPTz96YtTuUlwG3i3EZG4WlniBvR9bd+iJxCUY= -github.com/pulumi/providertest v0.0.11 h1:mg8MQ7Cq7+9XlHIkBD+aCqQO4mwAJEISngZgVdnQUe8= -github.com/pulumi/providertest v0.0.11/go.mod h1:HsxjVsytcMIuNj19w1lT2W0QXY0oReXl1+h6eD2JXP8= +github.com/pulumi/providertest v0.0.13 h1:9CAaoviOTuCVHDI15h3znXa5JsKYtXLYHIIdxOCzo3Y= +github.com/pulumi/providertest v0.0.13/go.mod h1:REAoaN+hGOtdWJGirfWYqcSjCejlbGfzyVTUuemJTuE= github.com/pulumi/pulumi-java/pkg v0.11.0 h1:Jw9gBvyfmfOMq/EkYDm9+zGPxsDAA8jfeMpHmtZ+1oA= github.com/pulumi/pulumi-java/pkg v0.11.0/go.mod h1:sXAk25P47AQVQL6ilAbFmRNgZykC7og/+87ihnqzFTc= github.com/pulumi/pulumi-yaml v1.8.0 h1:bhmidiCMMuzsJao5FE0UR69iF3WVKPCFrRkzjotFNn4= diff --git a/pkg/tests/go.mod b/pkg/tests/go.mod index 95d72e636..49959e926 100644 --- a/pkg/tests/go.mod +++ b/pkg/tests/go.mod @@ -8,6 +8,7 @@ replace ( ) require ( + github.com/hashicorp/terraform-plugin-sdk v1.7.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 github.com/hexops/autogold/v2 v2.2.1 github.com/hexops/valast v1.4.4 @@ -91,6 +92,7 @@ require ( github.com/ulikunitz/xz v0.5.10 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + github.com/zclconf/go-cty-yaml v1.0.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect go.opentelemetry.io/otel v1.24.0 // indirect diff --git a/pkg/tests/go.sum b/pkg/tests/go.sum index 35c379756..180bd055f 100644 --- a/pkg/tests/go.sum +++ b/pkg/tests/go.sum @@ -1651,6 +1651,7 @@ github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93 h1:T1Q6ag9tCwun16AW+ github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 h1:+RyjwU+Gnd/aTJBPZVDNm903eXVjjqhbaR4Ypx3xYyY= github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= diff --git a/pkg/tests/schemaconvert/schemaconvert.go b/pkg/tests/schemaconvert/schemaconvert.go new file mode 100644 index 000000000..6aca18e52 --- /dev/null +++ b/pkg/tests/schemaconvert/schemaconvert.go @@ -0,0 +1,130 @@ +package schemaconvert + +import ( + v1Schema "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + v2Schema "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/pulumi/pulumi/sdk/v3/go/common/util/contract" +) + +func Sdkv2ToV1Type(t v2Schema.ValueType) v1Schema.ValueType { + return v1Schema.ValueType(t) +} + +func Sdkv2ToV1SchemaOrResource(elem interface{}) interface{} { + switch elem := elem.(type) { + case nil: + return nil + case *v2Schema.Schema: + return Sdkv2ToV1Schema(elem) + case *v2Schema.Resource: + return Sdkv2ToV1Resource(elem) + default: + contract.Failf("unexpected type %T", elem) + return nil + } +} + +func Sdkv2ToV1Resource(sch *v2Schema.Resource) *v1Schema.Resource { + if sch.MigrateState != nil { + contract.Failf("MigrateState is not supported in conversion") + } + if sch.StateUpgraders != nil { + contract.Failf("StateUpgraders is not supported in conversion") + } + if sch.Create != nil || sch.Read != nil || sch.Update != nil || sch.Delete != nil || sch.Exists != nil || + sch.CreateContext != nil || sch.ReadContext != nil || sch.UpdateContext != nil || sch.DeleteContext != nil || sch.Importer != nil { + contract.Failf("runtime methods not supported in conversion") + } + + if sch.CustomizeDiff != nil { + contract.Failf("CustomizeDiff is not supported in conversion") + } + + timeouts := v1Schema.ResourceTimeout{} + if sch.Timeouts != nil { + timeouts = v1Schema.ResourceTimeout{ + Create: sch.Timeouts.Create, + Read: sch.Timeouts.Read, + Update: sch.Timeouts.Update, + Delete: sch.Timeouts.Delete, + Default: sch.Timeouts.Default, + } + } + timoutsPtr := &timeouts + if sch.Timeouts == nil { + timoutsPtr = nil + } + + return &v1Schema.Resource{ + Schema: Sdkv2ToV1SchemaMap(sch.Schema), + SchemaVersion: sch.SchemaVersion, + DeprecationMessage: sch.DeprecationMessage, + Timeouts: timoutsPtr, + } +} + +func Sdkv2ToV1Schema(sch *v2Schema.Schema) *v1Schema.Schema { + if sch.DiffSuppressFunc != nil { + contract.Failf("DiffSuppressFunc is not supported in conversion") + } + + defaultFunc := v1Schema.SchemaDefaultFunc(nil) + if sch.DefaultFunc != nil { + defaultFunc = func() (interface{}, error) { + return sch.DefaultFunc() + } + } + + stateFunc := v1Schema.SchemaStateFunc(nil) + if sch.StateFunc != nil { + stateFunc = func(i interface{}) string { + return sch.StateFunc(i) + } + } + + set := v1Schema.SchemaSetFunc(nil) + if sch.Set != nil { + set = func(i interface{}) int { + return sch.Set(i) + } + } + + validateFunc := v1Schema.SchemaValidateFunc(nil) + if sch.ValidateFunc != nil { + validateFunc = func(i interface{}, s string) ([]string, []error) { + return sch.ValidateFunc(i, s) + } + } + + return &v1Schema.Schema{ + Type: Sdkv2ToV1Type(sch.Type), + Optional: sch.Optional, + Required: sch.Required, + Default: sch.Default, + DefaultFunc: defaultFunc, + Description: sch.Description, + InputDefault: sch.InputDefault, + Computed: sch.Computed, + ForceNew: sch.ForceNew, + StateFunc: stateFunc, + Elem: Sdkv2ToV1SchemaOrResource(sch.Elem), + MaxItems: sch.MaxItems, + MinItems: sch.MinItems, + Set: set, + ComputedWhen: sch.ComputedWhen, + ConflictsWith: sch.ConflictsWith, + ExactlyOneOf: sch.ExactlyOneOf, + AtLeastOneOf: sch.AtLeastOneOf, + Deprecated: sch.Deprecated, + ValidateFunc: validateFunc, + Sensitive: sch.Sensitive, + } +} + +func Sdkv2ToV1SchemaMap(sch map[string]*v2Schema.Schema) map[string]*v1Schema.Schema { + res := make(map[string]*v1Schema.Schema) + for k, v := range sch { + res[k] = Sdkv2ToV1Schema(v) + } + return res +} diff --git a/pkg/tfbridge/diff_test.go b/pkg/tfbridge/diff_test.go index 03f70d874..fe4217f73 100644 --- a/pkg/tfbridge/diff_test.go +++ b/pkg/tfbridge/diff_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tests/schemaconvert" shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim" shimv1 "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v1" shimv2 "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2" @@ -197,15 +198,9 @@ func TestCustomizeDiff(t *testing.T) { }) } -func diffTest(t *testing.T, tfs map[string]*schema.Schema, info map[string]*SchemaInfo, - inputs, state map[string]interface{}, expected map[string]DiffKind, - expectedDiffChanges pulumirpc.DiffResponse_DiffChanges, - ignoreChanges ...string) { - ctx := context.Background() - - inputsMap := resource.NewPropertyMapFromMap(inputs) - stateMap := resource.NewPropertyMapFromMap(state) - +func v1Setup(tfs map[string]*schema.Schema) ( + shim.SchemaMap, Resource, shim.Provider, map[string]*SchemaInfo, +) { sch := shimv1.NewSchemaMap(tfs) // Fake up a TF resource and a TF provider. @@ -220,59 +215,126 @@ func diffTest(t *testing.T, tfs map[string]*schema.Schema, info map[string]*Sche "resource": res, }, }) + info := map[string]*SchemaInfo{} // Convert the inputs and state to TF config and resource attributes. r := Resource{ TF: shimv1.NewResource(res), Schema: &ResourceInfo{Fields: info}, } - tfState, err := makeTerraformStateWithOpts(ctx, r, "id", stateMap, - makeTerraformStateOptions{defaultZeroSchemaVersion: true}) - assert.NoError(t, err) - config, _, err := MakeTerraformConfig(ctx, &Provider{tf: provider}, inputsMap, sch, info) - assert.NoError(t, err) + return sch, r, provider, info +} - t.Run("standard", func(t *testing.T) { - tfDiff, err := provider.Diff(ctx, "resource", tfState, config, shim.DiffOptions{ - IgnoreChanges: newIgnoreChanges(ctx, sch, info, stateMap, inputsMap, ignoreChanges), - }) - assert.NoError(t, err) +func v1SetupFromv2Schema(tfs map[string]*v2Schema.Schema) ( + shim.SchemaMap, Resource, shim.Provider, map[string]*SchemaInfo, +) { + v1Schema := schemaconvert.Sdkv2ToV1SchemaMap(tfs) + return v1Setup(v1Schema) +} - // Convert the diff to a detailed diff and check the result. - diff, changes := makeDetailedDiff(ctx, sch, info, stateMap, inputsMap, tfDiff) - expectedDiff := map[string]*pulumirpc.PropertyDiff{} - for k, v := range expected { - expectedDiff[k] = &pulumirpc.PropertyDiff{Kind: v} - } - assert.Equal(t, expectedDiffChanges, changes) - assert.Equal(t, expectedDiff, diff) +func v2Setup(tfs map[string]*v2Schema.Schema) ( + shim.SchemaMap, Resource, shim.Provider, map[string]*SchemaInfo, +) { + sch := shimv2.NewSchemaMap(tfs) + + // Fake up a TF resource and a TF provider. + res := &v2Schema.Resource{ + Schema: tfs, + CustomizeDiff: func(_ context.Context, d *v2Schema.ResourceDiff, _ interface{}) error { + return d.SetNewComputed("outp") + }, + } + provider := shimv2.NewProvider(&v2Schema.Provider{ + ResourcesMap: map[string]*v2Schema.Resource{ + "resource": res, + }, }) + info := map[string]*SchemaInfo{} - // Add an ignoreChanges entry for each path in the expected diff, then re-convert the diff - // and check the result. - t.Run("withIgnoreAllExpected", func(t *testing.T) { - for k := range expected { - ignoreChanges = append(ignoreChanges, k) - } - tfDiff, err := provider.Diff(ctx, "resource", tfState, config, shim.DiffOptions{ - IgnoreChanges: newIgnoreChanges(ctx, sch, info, stateMap, inputsMap, ignoreChanges), - }) - assert.NoError(t, err) + // Convert the inputs and state to TF config and resource attributes. + r := Resource{ + TF: shimv2.NewResource(res), + Schema: &ResourceInfo{Fields: info}, + } - diff, changes := makeDetailedDiff(ctx, sch, info, stateMap, inputsMap, tfDiff) - assert.Equal(t, pulumirpc.DiffResponse_DIFF_NONE, changes) - assert.Equal(t, map[string]*pulumirpc.PropertyDiff{}, diff) - }) + return sch, r, provider, info +} + +// type for v2Setup and v1SetupFromv2Schema +type setupFunc func(tfs map[string]*v2Schema.Schema) ( + shim.SchemaMap, Resource, shim.Provider, map[string]*SchemaInfo) + +func diffTest(t *testing.T, tfs map[string]*v2Schema.Schema, inputs, + state map[string]interface{}, expected map[string]DiffKind, + expectedDiffChanges pulumirpc.DiffResponse_DiffChanges, + ignoreChanges ...string, +) { + ctx := context.Background() + + inputsMap := resource.NewPropertyMapFromMap(inputs) + stateMap := resource.NewPropertyMapFromMap(state) + + setup := []struct { + name string + setup setupFunc + }{ + {"v1", v1SetupFromv2Schema}, + {"v2", v2Setup}, + } + + for _, s := range setup { + t.Run(s.name, func(t *testing.T) { + sch, r, provider, info := s.setup(tfs) + + tfState, err := makeTerraformStateWithOpts(ctx, r, "id", stateMap, + makeTerraformStateOptions{defaultZeroSchemaVersion: true}) + assert.NoError(t, err) + + config, _, err := MakeTerraformConfig(ctx, &Provider{tf: provider}, inputsMap, sch, info) + assert.NoError(t, err) + + t.Run("standard", func(t *testing.T) { + tfDiff, err := provider.Diff(ctx, "resource", tfState, config, shim.DiffOptions{ + IgnoreChanges: newIgnoreChanges(ctx, sch, info, stateMap, inputsMap, ignoreChanges), + }) + assert.NoError(t, err) + + // Convert the diff to a detailed diff and check the result. + diff, changes := makeDetailedDiff(ctx, sch, info, stateMap, inputsMap, tfDiff) + expectedDiff := map[string]*pulumirpc.PropertyDiff{} + for k, v := range expected { + expectedDiff[k] = &pulumirpc.PropertyDiff{Kind: v} + } + assert.Equal(t, expectedDiffChanges, changes) + assert.Equal(t, expectedDiff, diff) + }) + + // Add an ignoreChanges entry for each path in the expected diff, then re-convert the diff + // and check the result. + t.Run("withIgnoreAllExpected", func(t *testing.T) { + for k := range expected { + ignoreChanges = append(ignoreChanges, k) + } + tfDiff, err := provider.Diff(ctx, "resource", tfState, config, shim.DiffOptions{ + IgnoreChanges: newIgnoreChanges(ctx, sch, info, stateMap, inputsMap, ignoreChanges), + }) + assert.NoError(t, err) + + diff, changes := makeDetailedDiff(ctx, sch, info, stateMap, inputsMap, tfDiff) + assert.Equal(t, pulumirpc.DiffResponse_DIFF_NONE, changes) + assert.Equal(t, map[string]*pulumirpc.PropertyDiff{}, diff) + }) + }) + } } func TestCustomDiffProducesReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeString}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeString}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "foo", }, @@ -286,11 +348,10 @@ func TestCustomDiffProducesReplace(t *testing.T) { func TestEmptyDiff(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeString}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeString}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "foo", }, @@ -304,11 +365,10 @@ func TestEmptyDiff(t *testing.T) { func TestSimpleAdd(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeString, Optional: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeString, Optional: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "foo", }, @@ -323,11 +383,10 @@ func TestSimpleAdd(t *testing.T) { func TestSimpleAddReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeString, Optional: true, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeString, Optional: true, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "foo", }, @@ -342,11 +401,10 @@ func TestSimpleAddReplace(t *testing.T) { func TestSimpleDelete(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeString, Optional: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeString, Optional: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": "foo", @@ -360,11 +418,10 @@ func TestSimpleDelete(t *testing.T) { func TestSimpleDeleteReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeString, Optional: true, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeString, Optional: true, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": "foo", @@ -378,11 +435,10 @@ func TestSimpleDeleteReplace(t *testing.T) { func TestSimpleUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeString}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeString}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "baz", }, @@ -398,11 +454,10 @@ func TestSimpleUpdate(t *testing.T) { func TestSimpleUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeString, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeString, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "baz", }, @@ -418,11 +473,10 @@ func TestSimpleUpdateReplace(t *testing.T) { func TestNestedAdd(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeMap}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeMap}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": map[string]interface{}{"nest": "foo"}, }, @@ -437,11 +491,10 @@ func TestNestedAdd(t *testing.T) { func TestNestedAddReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeMap, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeMap, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": map[string]interface{}{"nest": "foo"}, }, @@ -456,11 +509,10 @@ func TestNestedAddReplace(t *testing.T) { func TestNestedDelete(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeMap}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeMap}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": map[string]interface{}{"nest": "foo"}, @@ -474,11 +526,10 @@ func TestNestedDelete(t *testing.T) { func TestNestedDeleteReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeMap, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeMap, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": map[string]interface{}{"nest": "foo"}, @@ -492,11 +543,10 @@ func TestNestedDeleteReplace(t *testing.T) { func TestNestedUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeMap}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeMap}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": map[string]interface{}{"nest": "baz"}, }, @@ -512,11 +562,10 @@ func TestNestedUpdate(t *testing.T) { func TestNestedUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeMap, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeMap, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": map[string]interface{}{"nest": "baz"}, }, @@ -532,11 +581,10 @@ func TestNestedUpdateReplace(t *testing.T) { func TestNestedIgnore(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeMap, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeMap, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": map[string]interface{}{"nest": "baz"}, }, @@ -551,11 +599,10 @@ func TestNestedIgnore(t *testing.T) { func TestListAdd(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{"foo"}, }, @@ -570,11 +617,10 @@ func TestListAdd(t *testing.T) { func TestListAddReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{"foo"}, }, @@ -589,11 +635,10 @@ func TestListAddReplace(t *testing.T) { func TestListDelete(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": []interface{}{"foo"}, @@ -607,11 +652,10 @@ func TestListDelete(t *testing.T) { func TestListDeleteReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": []interface{}{"foo"}, @@ -625,11 +669,10 @@ func TestListDeleteReplace(t *testing.T) { func TestListUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{"baz"}, }, @@ -645,11 +688,10 @@ func TestListUpdate(t *testing.T) { func TestListUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{"baz"}, }, @@ -665,11 +707,10 @@ func TestListUpdateReplace(t *testing.T) { func TestListIgnore(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{"baz"}, }, @@ -684,11 +725,10 @@ func TestListIgnore(t *testing.T) { func TestMaxItemsOneListAdd(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, MaxItems: 1}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, MaxItems: 1}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "foo", }, @@ -704,11 +744,10 @@ func TestMaxItemsOneListAdd(t *testing.T) { func TestMaxItemsOneListAddReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true, MaxItems: 1}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true, MaxItems: 1}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "foo", }, @@ -724,11 +763,10 @@ func TestMaxItemsOneListAddReplace(t *testing.T) { func TestMaxItemsOneListDelete(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, MaxItems: 1}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, MaxItems: 1}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": "foo", @@ -742,11 +780,10 @@ func TestMaxItemsOneListDelete(t *testing.T) { func TestMaxItemsOneListDeleteReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true, MaxItems: 1}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true, MaxItems: 1}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": "foo", @@ -760,11 +797,10 @@ func TestMaxItemsOneListDeleteReplace(t *testing.T) { func TestMaxItemsOneListUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, MaxItems: 1}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, MaxItems: 1}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "baz", }, @@ -780,11 +816,10 @@ func TestMaxItemsOneListUpdate(t *testing.T) { func TestMaxItemsOneListUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true, MaxItems: 1}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true, MaxItems: 1}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "baz", }, @@ -800,11 +835,10 @@ func TestMaxItemsOneListUpdateReplace(t *testing.T) { func TestMaxItemsOneListIgnore(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, MaxItems: 1}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, MaxItems: 1}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "baz", }, @@ -819,15 +853,14 @@ func TestMaxItemsOneListIgnore(t *testing.T) { func TestSetAdd(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, + Type: v2Schema.TypeSet, Set: func(_ interface{}) int { return 0 }, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{"foo"}, }, @@ -842,16 +875,15 @@ func TestSetAdd(t *testing.T) { func TestSetAddReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, + Type: v2Schema.TypeSet, Set: func(_ interface{}) int { return 0 }, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{"foo"}, }, @@ -866,15 +898,14 @@ func TestSetAddReplace(t *testing.T) { func TestSetDelete(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, + Type: v2Schema.TypeSet, Set: func(_ interface{}) int { return 0 }, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": []interface{}{"foo"}, @@ -888,16 +919,15 @@ func TestSetDelete(t *testing.T) { func TestSetDeleteReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, + Type: v2Schema.TypeSet, Set: func(_ interface{}) int { return 0 }, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": []interface{}{"foo"}, @@ -911,11 +941,10 @@ func TestSetDeleteReplace(t *testing.T) { func TestSetUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{"baz"}, }, @@ -931,11 +960,10 @@ func TestSetUpdate(t *testing.T) { func TestSetIgnore(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{"baz"}, }, @@ -950,11 +978,10 @@ func TestSetIgnore(t *testing.T) { func TestSetUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{"baz"}, }, @@ -970,16 +997,15 @@ func TestSetUpdateReplace(t *testing.T) { func TestMaxItemsOneSetAdd(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, + Type: v2Schema.TypeSet, Set: func(_ interface{}) int { return 0 }, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, MaxItems: 1, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "foo", }, @@ -995,17 +1021,16 @@ func TestMaxItemsOneSetAdd(t *testing.T) { func TestMaxItemsOneSetAddReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, + Type: v2Schema.TypeSet, Set: func(_ interface{}) int { return 0 }, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, MaxItems: 1, ForceNew: true, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "foo", }, @@ -1021,16 +1046,15 @@ func TestMaxItemsOneSetAddReplace(t *testing.T) { func TestMaxItemsOneSetDelete(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, + Type: v2Schema.TypeSet, Set: func(_ interface{}) int { return 0 }, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, MaxItems: 1, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": "foo", @@ -1044,17 +1068,16 @@ func TestMaxItemsOneSetDelete(t *testing.T) { func TestMaxItemsOneSetDeleteReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, + Type: v2Schema.TypeSet, Set: func(_ interface{}) int { return 0 }, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, MaxItems: 1, ForceNew: true, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{}, map[string]interface{}{ "prop": "foo", @@ -1068,11 +1091,10 @@ func TestMaxItemsOneSetDeleteReplace(t *testing.T) { func TestMaxItemsOneSetUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}, MaxItems: 1}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, MaxItems: 1}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "baz", }, @@ -1088,11 +1110,10 @@ func TestMaxItemsOneSetUpdate(t *testing.T) { func TestMaxItemsOneSetIgnore(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}, MaxItems: 1}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, MaxItems: 1}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "baz", }, @@ -1107,11 +1128,10 @@ func TestMaxItemsOneSetIgnore(t *testing.T) { func TestMaxItemsOneSetUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true, MaxItems: 1}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true, MaxItems: 1}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": "baz", }, @@ -1127,18 +1147,17 @@ func TestMaxItemsOneSetUpdateReplace(t *testing.T) { func TestSetNestedUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true}, + Type: v2Schema.TypeSet, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true}, }, }, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{map[string]interface{}{"nest": "baz"}}, }, @@ -1154,18 +1173,17 @@ func TestSetNestedUpdate(t *testing.T) { func TestSetNestedUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true, ForceNew: true}, + Type: v2Schema.TypeSet, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true, ForceNew: true}, }, }, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{map[string]interface{}{"nest": "baz"}}, }, @@ -1182,18 +1200,17 @@ func TestSetNestedUpdateReplace(t *testing.T) { func TestSetNestedIgnore(t *testing.T) { for _, ignore := range []string{"prop[0]", "prop"} { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true}, + Type: v2Schema.TypeSet, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true}, }, }, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{map[string]interface{}{"nest": "baz"}}, }, @@ -1209,11 +1226,10 @@ func TestSetNestedIgnore(t *testing.T) { func TestComputedSimpleUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeString}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeString}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": computedValue, }, @@ -1229,11 +1245,10 @@ func TestComputedSimpleUpdate(t *testing.T) { func TestComputedSimpleUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeString, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeString, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": computedValue, }, @@ -1249,11 +1264,10 @@ func TestComputedSimpleUpdateReplace(t *testing.T) { func TestComputedMapUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeMap}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeMap}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": computedValue, }, @@ -1269,11 +1283,10 @@ func TestComputedMapUpdate(t *testing.T) { func TestComputedNestedUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeMap}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeMap}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": map[string]interface{}{"nest": computedValue}, }, @@ -1289,11 +1302,10 @@ func TestComputedNestedUpdate(t *testing.T) { func TestComputedNestedUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeMap, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeMap, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": map[string]interface{}{"nest": computedValue}, }, @@ -1309,11 +1321,10 @@ func TestComputedNestedUpdateReplace(t *testing.T) { func TestComputedNestedIgnore(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeMap}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeMap}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": map[string]interface{}{"nest": computedValue}, }, @@ -1328,11 +1339,10 @@ func TestComputedNestedIgnore(t *testing.T) { func TestComputedListUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": computedValue, }, @@ -1348,11 +1358,10 @@ func TestComputedListUpdate(t *testing.T) { func TestComputedListElementUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{computedValue}, }, @@ -1368,11 +1377,10 @@ func TestComputedListElementUpdate(t *testing.T) { func TestComputedListElementUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{computedValue}, }, @@ -1388,11 +1396,10 @@ func TestComputedListElementUpdateReplace(t *testing.T) { func TestComputedListElementIgnore(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeList, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeList, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{computedValue}, }, @@ -1407,11 +1414,10 @@ func TestComputedListElementIgnore(t *testing.T) { func TestComputedSetUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": computedValue, }, @@ -1427,11 +1433,10 @@ func TestComputedSetUpdate(t *testing.T) { func TestNestedComputedSetUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{computedValue}, }, @@ -1447,11 +1452,10 @@ func TestNestedComputedSetUpdate(t *testing.T) { func TestNestedComputedSetAdd(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{computedValue}, }, @@ -1466,11 +1470,10 @@ func TestNestedComputedSetAdd(t *testing.T) { func TestNestedComputedSetUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{computedValue}, }, @@ -1486,11 +1489,10 @@ func TestNestedComputedSetUpdateReplace(t *testing.T) { func TestNestedComputedSetIntUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeInt}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeInt}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{computedValue}, }, @@ -1506,11 +1508,10 @@ func TestNestedComputedSetIntUpdate(t *testing.T) { func TestNestedComputedSetIntUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeInt}, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeInt}, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{computedValue}, }, @@ -1526,11 +1527,10 @@ func TestNestedComputedSetIntUpdateReplace(t *testing.T) { func TestNestedComputedSetIntAdd(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeInt}}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeInt}}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{computedValue}, }, @@ -1545,11 +1545,10 @@ func TestNestedComputedSetIntAdd(t *testing.T) { func TestComputedSetUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ - "prop": {Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}, ForceNew: true}, - "outp": {Type: schema.TypeString, Computed: true}, + map[string]*v2Schema.Schema{ + "prop": {Type: v2Schema.TypeSet, Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": computedValue, }, @@ -1565,18 +1564,17 @@ func TestComputedSetUpdateReplace(t *testing.T) { func TestComputedSetNestedUpdate(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true}, + Type: v2Schema.TypeSet, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true}, }, }, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{map[string]interface{}{"nest": computedValue}}, }, @@ -1592,18 +1590,17 @@ func TestComputedSetNestedUpdate(t *testing.T) { func TestComputedSetNestedUpdateReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true, ForceNew: true}, + Type: v2Schema.TypeSet, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true, ForceNew: true}, }, }, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{map[string]interface{}{"nest": computedValue}}, }, @@ -1620,18 +1617,17 @@ func TestComputedSetNestedUpdateReplace(t *testing.T) { func TestComputedSetNestedIgnore(t *testing.T) { for _, ignore := range []string{"prop[0]", "prop"} { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true}, + Type: v2Schema.TypeSet, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true}, }, }, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{map[string]interface{}{"nest": computedValue}}, }, @@ -1647,24 +1643,23 @@ func TestComputedSetNestedIgnore(t *testing.T) { func TestRawElementNames(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeList, + Type: v2Schema.TypeList, Optional: true, MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ "variables": { - Type: schema.TypeMap, + Type: v2Schema.TypeMap, Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, }, }, }, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": map[string]interface{}{ "variables": map[string]interface{}{ @@ -1844,19 +1839,19 @@ func TestCollectionsWithMultipleItems(t *testing.T) { }, } - runTestCase := func(t *testing.T, name string, typ schema.ValueType, inputs, state []interface{}, - expected map[string]DiffKind, expectedChanges pulumirpc.DiffResponse_DiffChanges) { + runTestCase := func(t *testing.T, name string, typ v2Schema.ValueType, inputs, state []interface{}, + expected map[string]DiffKind, expectedChanges pulumirpc.DiffResponse_DiffChanges, + ) { t.Run(name, func(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { Type: typ, - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &v2Schema.Schema{Type: v2Schema.TypeString}, ForceNew: true, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": inputs, // inputs }, @@ -1872,32 +1867,31 @@ func TestCollectionsWithMultipleItems(t *testing.T) { t.Run("Set", func(t *testing.T) { for _, tc := range testCases { - runTestCase(t, tc.name, schema.TypeSet, tc.input, tc.state, tc.expectedDiffForSet, tc.expectedChangesForSet) + runTestCase(t, tc.name, v2Schema.TypeSet, tc.input, tc.state, tc.expectedDiffForSet, tc.expectedChangesForSet) } }) t.Run("List", func(t *testing.T) { for _, tc := range testCases { - runTestCase(t, tc.name, schema.TypeList, tc.input, tc.state, tc.expectedDiffForList, tc.expectedChangesForList) + runTestCase(t, tc.name, v2Schema.TypeList, tc.input, tc.state, tc.expectedDiffForList, tc.expectedChangesForList) } }) } func TestSetNestedAddReplace(t *testing.T) { diffTest(t, - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true}, + Type: v2Schema.TypeSet, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true}, }, }, ForceNew: true, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, - map[string]*SchemaInfo{}, map[string]interface{}{ "prop": []interface{}{map[string]interface{}{"nest": "baz"}}, }, @@ -1914,20 +1908,19 @@ func TestSetNestedAddReplace(t *testing.T) { func TestListNestedAddReplace(t *testing.T) { diffTest(t, // tfSchema - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeList, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true}, + Type: v2Schema.TypeList, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true}, }, }, ForceNew: true, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, // info - map[string]*SchemaInfo{}, // inputs map[string]interface{}{ "prop": []interface{}{map[string]interface{}{"nest": "foo"}}, @@ -1947,20 +1940,19 @@ func TestListNestedAddReplace(t *testing.T) { func TestListNestedUpdate(t *testing.T) { diffTest(t, // tfSchema - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeList, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true}, + Type: v2Schema.TypeList, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true}, }, }, ForceNew: true, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, // info - map[string]*SchemaInfo{}, // inputs map[string]interface{}{ "prop": []interface{}{map[string]interface{}{"nest": "foo"}}, @@ -1980,20 +1972,19 @@ func TestListNestedUpdate(t *testing.T) { func TestListNestedDeleteReplace(t *testing.T) { diffTest(t, // tfSchema - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeList, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true}, + Type: v2Schema.TypeList, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true}, }, }, ForceNew: true, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, // info - map[string]*SchemaInfo{}, // inputs map[string]interface{}{}, // state @@ -2011,20 +2002,19 @@ func TestListNestedDeleteReplace(t *testing.T) { func TestSetNestedDeleteReplace(t *testing.T) { diffTest(t, // tfSchema - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeSet, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true}, + Type: v2Schema.TypeSet, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true}, }, }, ForceNew: true, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, // info - map[string]*SchemaInfo{}, // inputs map[string]interface{}{}, // state @@ -2042,21 +2032,20 @@ func TestSetNestedDeleteReplace(t *testing.T) { func TestListNestedAddMaxItemsOne(t *testing.T) { diffTest(t, // tfSchema - map[string]*schema.Schema{ + map[string]*v2Schema.Schema{ "prop": { - Type: schema.TypeList, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "nest": {Type: schema.TypeString, Required: true}, + Type: v2Schema.TypeList, + Elem: &v2Schema.Resource{ + Schema: map[string]*v2Schema.Schema{ + "nest": {Type: v2Schema.TypeString, Required: true}, }, }, MaxItems: 1, ForceNew: true, }, - "outp": {Type: schema.TypeString, Computed: true}, + "outp": {Type: v2Schema.TypeString, Computed: true}, }, // info - map[string]*SchemaInfo{}, // inputs map[string]interface{}{ "prop": map[string]interface{}{"nest": "foo"},