From a77baa866dd18cda700a037ae9ab626778960442 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Thu, 6 Jul 2023 15:53:08 -0400 Subject: [PATCH] additional schema handling comment --- internal/providers/provider.go | 5 +++++ internal/providers/schemas.go | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/providers/provider.go b/internal/providers/provider.go index 49e6b57672..5e2cc06759 100644 --- a/internal/providers/provider.go +++ b/internal/providers/provider.go @@ -74,6 +74,11 @@ type Interface interface { Close() error } +// GetProviderSchemaResponse is the return type for GetProviderSchema, and +// should only be used when handling a value for that method. The handling of +// of schemas in any other context should always use ProviderSchema, so that +// the in-memory representation can be more easily changed separately from the +// RCP protocol. type GetProviderSchemaResponse struct { // Provider is the schema for the provider itself. Provider Schema diff --git a/internal/providers/schemas.go b/internal/providers/schemas.go index 762eca5841..5e7ffcb2d2 100644 --- a/internal/providers/schemas.go +++ b/internal/providers/schemas.go @@ -8,8 +8,9 @@ import ( "github.com/hashicorp/terraform/internal/configs/configschema" ) -// ProviderSchema is an overall container for all of the schemas for all configurable -// objects defined within a particular provider. +// ProviderSchema is an overall container for all of the schemas for all +// configurable objects defined within a particular provider. All storage of +// provider schemas should use this type. type ProviderSchema = GetProviderSchemaResponse // SchemaForResourceType attempts to find a schema for the given mode and type.