Skip to content

Commit 8ce6686

Browse files
committed
Adding UseJSONNumber to public API Surface to ensure compatibility
1 parent 2de4e60 commit 8ce6686

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

helper/schema/resource.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,22 @@ type Resource struct {
569569
// other user facing usage. It can be plain-text or markdown depending on the
570570
// global DescriptionKind setting. This field is valid for any Resource.
571571
Description string
572+
573+
// UseJSONNumber should be set when state upgraders will expect
574+
// json.Numbers instead of float64s for numbers. This is added as a
575+
// toggle for backwards compatibility for type assertions, but should
576+
// be used in all new resources to avoid bugs with sufficiently large
577+
// user input. This field is only valid when the Resource is a managed
578+
// resource.
579+
//
580+
// See github.com/hashicorp/terraform-plugin-sdk/issues/655 for more
581+
// details.
582+
//
583+
// Fork: We only add this for backward compatibility purposes. This
584+
// bool is not used in any of the codebase and serves only when a resource
585+
// has opted into `UseJSONNumber` in the resource definition. This only
586+
// is in place to allow providers to compile.
587+
UseJSONNumber bool
572588
}
573589

574590
// ShimInstanceStateFromValue converts a cty.Value to a

0 commit comments

Comments
 (0)