From 0dffe9dd7dd33f06b591efd7760c1df04366a1fd Mon Sep 17 00:00:00 2001 From: BradyBurke <51826266+bradyburke@users.noreply.github.com> Date: Tue, 16 Sep 2025 13:50:15 -0400 Subject: [PATCH 1/2] feat: implement comprehensive OpenAPI discriminator pattern support --- internal/cmd/generate.go | 11 +- internal/mapper/datasource_mapper.go | 14 +- internal/mapper/oas/build.go | 255 +++++++++++++++++++++++++-- internal/mapper/oas/oas_schema.go | 8 + internal/mapper/provider_mapper.go | 13 +- internal/mapper/resource_mapper.go | 20 ++- 6 files changed, 293 insertions(+), 28 deletions(-) diff --git a/internal/cmd/generate.go b/internal/cmd/generate.go index 160c383f..6ab364b4 100644 --- a/internal/cmd/generate.go +++ b/internal/cmd/generate.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/cli" "github.com/pb33f/libopenapi" + high "github.com/pb33f/libopenapi/datamodel/high/v3" "github.com/pb33f/libopenapi/index" ) @@ -148,7 +149,7 @@ func (cmd *GenerateCommand) runInternal(logger *slog.Logger) error { // 5. Generate provider code spec w/ config oasExplorer := explorer.NewConfigExplorer(model.Model, *config) - providerCodeSpec, err := generateProviderCodeSpec(logger, oasExplorer, *config) + providerCodeSpec, err := generateProviderCodeSpec(logger, oasExplorer, &model.Model, *config) if err != nil { return err } @@ -181,7 +182,7 @@ func (cmd *GenerateCommand) runInternal(logger *slog.Logger) error { return nil } -func generateProviderCodeSpec(logger *slog.Logger, dora explorer.Explorer, cfg config.Config) (*spec.Specification, error) { +func generateProviderCodeSpec(logger *slog.Logger, dora explorer.Explorer, document *high.Document, cfg config.Config) (*spec.Specification, error) { // 1. Find TF resources in OAS explorerResources, err := dora.FindResources() if err != nil { @@ -201,21 +202,21 @@ func generateProviderCodeSpec(logger *slog.Logger, dora explorer.Explorer, cfg c } // 4. Use TF info to generate provider code spec for resources - resourceMapper := mapper.NewResourceMapper(explorerResources, cfg) + resourceMapper := mapper.NewResourceMapper(explorerResources, document, cfg) resourcesIR, err := resourceMapper.MapToIR(logger) if err != nil { return nil, fmt.Errorf("error generating provider code spec for resources: %w", err) } // 5. Use TF info to generate provider code spec for data sources - dataSourceMapper := mapper.NewDataSourceMapper(explorerDataSources, cfg) + dataSourceMapper := mapper.NewDataSourceMapper(explorerDataSources, document, cfg) dataSourcesIR, err := dataSourceMapper.MapToIR(logger) if err != nil { return nil, fmt.Errorf("error generating provider code spec for data sources: %w", err) } // 6. Use TF info to generate provider code spec for provider - providerMapper := mapper.NewProviderMapper(explorerProvider, cfg) + providerMapper := mapper.NewProviderMapper(explorerProvider, document, cfg) providerIR, err := providerMapper.MapToIR(logger) if err != nil { return nil, fmt.Errorf("error generating provider code spec for provider: %w", err) diff --git a/internal/mapper/datasource_mapper.go b/internal/mapper/datasource_mapper.go index ac0229e3..e49d1510 100644 --- a/internal/mapper/datasource_mapper.go +++ b/internal/mapper/datasource_mapper.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" + high "github.com/pb33f/libopenapi/datamodel/high/v3" ) var _ DataSourceMapper = dataSourceMapper{} @@ -25,13 +26,15 @@ type DataSourceMapper interface { type dataSourceMapper struct { dataSources map[string]explorer.DataSource + document *high.Document //nolint:unused // Might be useful later! cfg config.Config } -func NewDataSourceMapper(dataSources map[string]explorer.DataSource, cfg config.Config) DataSourceMapper { +func NewDataSourceMapper(dataSources map[string]explorer.DataSource, document *high.Document, cfg config.Config) DataSourceMapper { return dataSourceMapper{ dataSources: dataSources, + document: document, cfg: cfg, } } @@ -45,7 +48,7 @@ func (m dataSourceMapper) MapToIR(logger *slog.Logger) ([]datasource.DataSource, dataSource := m.dataSources[name] dLogger := logger.With("data_source", name) - schema, err := generateDataSourceSchema(dLogger, name, dataSource) + schema, err := generateDataSourceSchema(dLogger, name, dataSource, m.document) if err != nil { log.WarnLogOnError(dLogger, err, "skipping data source schema mapping") continue @@ -60,7 +63,7 @@ func (m dataSourceMapper) MapToIR(logger *slog.Logger) ([]datasource.DataSource, return dataSourceSchemas, nil } -func generateDataSourceSchema(logger *slog.Logger, name string, dataSource explorer.DataSource) (*datasource.Schema, error) { +func generateDataSourceSchema(logger *slog.Logger, name string, dataSource explorer.DataSource, document *high.Document) (*datasource.Schema, error) { dataSourceSchema := &datasource.Schema{ Attributes: []datasource.Attribute{}, } @@ -75,6 +78,7 @@ func generateDataSourceSchema(logger *slog.Logger, name string, dataSource explo } globalSchemaOpts := oas.GlobalSchemaOpts{ OverrideComputability: schema.Computed, + Document: document, } readResponseSchema, err := oas.BuildSchemaFromResponse(dataSource.ReadOp, schemaOpts, globalSchemaOpts) if err != nil { @@ -118,7 +122,9 @@ func generateDataSourceSchema(logger *slog.Logger, name string, dataSource explo OverrideDescription: param.Description, } - s, schemaErr := oas.BuildSchema(param.Schema, schemaOpts, oas.GlobalSchemaOpts{}) + s, schemaErr := oas.BuildSchema(param.Schema, schemaOpts, oas.GlobalSchemaOpts{ + Document: document, + }) if schemaErr != nil { log.WarnLogOnError(pLogger, schemaErr, "skipping mapping of read operation parameter") continue diff --git a/internal/mapper/oas/build.go b/internal/mapper/oas/build.go index bd763dfd..d0ab3695 100644 --- a/internal/mapper/oas/build.go +++ b/internal/mapper/oas/build.go @@ -8,6 +8,7 @@ import ( "errors" "fmt" "strconv" + "strings" "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" @@ -97,7 +98,7 @@ func getSchemaFromMediaType(mediaTypes *orderedmap.Map[string, *high.MediaType], func BuildSchema(proxy *base.SchemaProxy, schemaOpts SchemaOpts, globalOpts GlobalSchemaOpts) (*OASSchema, *SchemaError) { resp := OASSchema{} - s, err := buildSchemaProxy(proxy) + s, err := buildSchemaProxy(proxy, globalOpts) if err != nil { return nil, err } @@ -125,12 +126,31 @@ func BuildSchema(proxy *base.SchemaProxy, schemaOpts SchemaOpts, globalOpts Glob // # Any other combinations of allOf, anyOf, or oneOf will return a SchemaError // // [schema composition]: https://json-schema.org/understanding-json-schema/reference/combining -func buildSchemaProxy(proxy *base.SchemaProxy) (*base.Schema, *SchemaError) { +func buildSchemaProxy(proxy *base.SchemaProxy, globalOpts GlobalSchemaOpts) (*base.Schema, *SchemaError) { s, err := proxy.BuildSchema() if err != nil { return nil, SchemaErrorFromProxy(fmt.Errorf("failed to build schema proxy - %w", err), proxy) } + // Check for discriminator patterns first - can work with oneOf, anyOf, allOf, or direct schemas + if s.Discriminator != nil { + // Prevent infinite recursion with depth limit + if globalOpts.DiscriminatorDepth > 5 { + // Skip discriminator processing at deep levels to prevent infinite recursion + return s, nil + } + + // Increment depth for recursive calls + nextGlobalOpts := globalOpts + nextGlobalOpts.DiscriminatorDepth++ + + flattenedSchema, err := flattenDiscriminatorSchema(s, proxy, nextGlobalOpts) + if err != nil { + return nil, err + } + return flattenedSchema, nil + } + // If there are no schema composition keywords, return the schema if len(s.AllOf) == 0 && len(s.AnyOf) == 0 && len(s.OneOf) == 0 { return s, nil @@ -138,7 +158,7 @@ func buildSchemaProxy(proxy *base.SchemaProxy) (*base.Schema, *SchemaError) { if len(s.AnyOf) > 0 { if len(s.AnyOf) == 2 { - schema, err := getMultiTypeSchema(s.AnyOf[0], s.AnyOf[1]) + schema, err := getMultiTypeSchema(s.AnyOf[0], s.AnyOf[1], globalOpts) if err != nil { return nil, err } @@ -152,7 +172,7 @@ func buildSchemaProxy(proxy *base.SchemaProxy) (*base.Schema, *SchemaError) { if len(s.OneOf) > 0 { if len(s.OneOf) == 2 { - schema, err := getMultiTypeSchema(s.OneOf[0], s.OneOf[1]) + schema, err := getMultiTypeSchema(s.OneOf[0], s.OneOf[1], globalOpts) if err != nil { return nil, err } @@ -166,7 +186,7 @@ func buildSchemaProxy(proxy *base.SchemaProxy) (*base.Schema, *SchemaError) { // If there is just one allOf, we can use it as the schema if len(s.AllOf) == 1 { - allOfSchema, err := buildSchemaProxy(s.AllOf[0]) + allOfSchema, err := buildSchemaProxy(s.AllOf[0], globalOpts) if err != nil { return nil, err } @@ -179,20 +199,28 @@ func buildSchemaProxy(proxy *base.SchemaProxy) (*base.Schema, *SchemaError) { return allOfSchema, nil } - // Combining multiple allOf schemas and their properties is possible here, but currently not supported - // See: https://github.com/hashicorp/terraform-plugin-codegen-openapi/issues/56 + // Handle multiple allOf schemas by merging their properties + if len(s.AllOf) > 1 { + composedSchema, err := composeAllOfSchemas(s, globalOpts) + if err != nil { + return nil, err + } + return composedSchema, nil + } + + // No schema composition keywords found return nil, SchemaErrorFromNode(fmt.Errorf("found %d allOf subschema(s), schema composition is currently not supported", len(s.AllOf)), s, AllOf) } // getMultiTypeSchema will check the types of both schemas provided and will return the non-null schema. If a null schema type is not // detected, an error will be returned as multi-types are not supported -func getMultiTypeSchema(proxyOne *base.SchemaProxy, proxyTwo *base.SchemaProxy) (*base.Schema, *SchemaError) { - firstSchema, err := buildSchemaProxy(proxyOne) +func getMultiTypeSchema(proxyOne *base.SchemaProxy, proxyTwo *base.SchemaProxy, globalOpts GlobalSchemaOpts) (*base.Schema, *SchemaError) { + firstSchema, err := buildSchemaProxy(proxyOne, globalOpts) if err != nil { return nil, err } - secondSchema, err := buildSchemaProxy(proxyTwo) + secondSchema, err := buildSchemaProxy(proxyTwo, globalOpts) if err != nil { return nil, err } @@ -256,6 +284,64 @@ func retrieveType(schema *base.Schema) (string, *SchemaError) { return "", SchemaErrorFromNode(fmt.Errorf("%v - %w", schema.Type, ErrMultiTypeSchema), schema, Type) } +// composeAllOfSchemas merges multiple allOf schemas into a single composed schema +// This is essential for discriminator patterns which use allOf to compose base + variant schemas +func composeAllOfSchemas(baseSchema *base.Schema, globalOpts GlobalSchemaOpts) (*base.Schema, *SchemaError) { + // Start with the base schema structure + composedSchema := &base.Schema{ + Type: baseSchema.Type, + Format: baseSchema.Format, + Description: baseSchema.Description, + Properties: orderedmap.New[string, *base.SchemaProxy](), + Required: []string{}, + ParentProxy: baseSchema.ParentProxy, + } + + // Copy base schema properties first + if baseSchema.Properties != nil { + for pair := range orderedmap.Iterate(context.TODO(), baseSchema.Properties) { + composedSchema.Properties.Set(pair.Key(), pair.Value()) + } + } + composedSchema.Required = append(composedSchema.Required, baseSchema.Required...) + + // Process each allOf sub-schema and merge their properties + for _, allOfProxy := range baseSchema.AllOf { + allOfSchema, err := buildSchemaProxy(allOfProxy, globalOpts) + if err != nil { + return nil, err + } + + // Merge properties from this allOf sub-schema + if allOfSchema.Properties != nil { + for pair := range orderedmap.Iterate(context.TODO(), allOfSchema.Properties) { + key := pair.Key() + value := pair.Value() + // Later schemas override earlier ones (right-to-left merge) + composedSchema.Properties.Set(key, value) + } + } + + // Merge required fields + composedSchema.Required = append(composedSchema.Required, allOfSchema.Required...) + + // Use the type and format from the first concrete schema that has them + if composedSchema.Type == nil && allOfSchema.Type != nil { + composedSchema.Type = allOfSchema.Type + } + if composedSchema.Format == "" && allOfSchema.Format != "" { + composedSchema.Format = allOfSchema.Format + } + + // Use description from the last schema that has one + if allOfSchema.Description != "" { + composedSchema.Description = allOfSchema.Description + } + } + + return composedSchema, nil +} + func isStringableType(t string) bool { switch t { case util.OAS_type_integer: @@ -268,3 +354,152 @@ func isStringableType(t string) bool { return false } } + +// flattenDiscriminatorSchema handles discriminator patterns by flattening all properties from the base schema +// and all discriminator sub-schemas into a single comprehensive schema. This ensures all possible fields +// are included in the generated Terraform resource schema. +// +// Discriminators can work with oneOf, anyOf, allOf, or direct mapping patterns. +func flattenDiscriminatorSchema(baseSchema *base.Schema, baseProxy *base.SchemaProxy, globalOpts GlobalSchemaOpts) (*base.Schema, *SchemaError) { + // Start with a copy of the base schema + flattenedSchema := &base.Schema{ + Type: baseSchema.Type, + Format: baseSchema.Format, + Description: baseSchema.Description, + Properties: orderedmap.New[string, *base.SchemaProxy](), + Required: []string{}, + ParentProxy: baseProxy, + } + + // Copy all base schema properties + if baseSchema.Properties != nil { + for pair := range orderedmap.Iterate(context.TODO(), baseSchema.Properties) { + flattenedSchema.Properties.Set(pair.Key(), pair.Value()) + } + } + + // Copy required fields from base schema + flattenedSchema.Required = append(flattenedSchema.Required, baseSchema.Required...) + + // Collect all sub-schemas from different composition patterns + var subSchemaProxies []*base.SchemaProxy + + // Handle oneOf discriminator pattern + if len(baseSchema.OneOf) > 0 { + subSchemaProxies = append(subSchemaProxies, baseSchema.OneOf...) + } + + // Handle anyOf discriminator pattern + if len(baseSchema.AnyOf) > 0 { + subSchemaProxies = append(subSchemaProxies, baseSchema.AnyOf...) + } + + // Handle allOf discriminator pattern (inheritance) + if len(baseSchema.AllOf) > 0 { + subSchemaProxies = append(subSchemaProxies, baseSchema.AllOf...) + } + + // Handle discriminator mapping if no composition keywords but mapping exists + if len(subSchemaProxies) == 0 && baseSchema.Discriminator != nil && baseSchema.Discriminator.Mapping != nil { + // Resolve external schema references from discriminator mapping + mappedSchemas, err := resolveDiscriminatorMapping(baseSchema.Discriminator.Mapping, globalOpts.Document) + if err != nil { + // Log error but continue with base schema - don't fail the entire process + return flattenedSchema, nil + } + subSchemaProxies = append(subSchemaProxies, mappedSchemas...) + } + + // Process each discriminator sub-schema and merge their properties + for _, subProxy := range subSchemaProxies { + subSchema, err := buildSchemaProxy(subProxy, globalOpts) + if err != nil { + // Log warning but continue - don't fail the entire process + continue + } + + // Merge properties from sub-schema + if subSchema.Properties != nil { + for pair := range orderedmap.Iterate(context.TODO(), subSchema.Properties) { + key := pair.Key() + value := pair.Value() + // Only add if property doesn't already exist (base schema takes precedence) + if _, exists := flattenedSchema.Properties.Get(key); !exists { + flattenedSchema.Properties.Set(key, value) + } + } + } + + // Merge required fields from sub-schema + // Note: In discriminator patterns, sub-schema required fields become optional in the flattened schema + // since they're only required for specific discriminator values + for _, requiredField := range subSchema.Required { + // Check if already in required list + found := false + for _, existing := range flattenedSchema.Required { + if existing == requiredField { + found = true + break + } + } + if !found { + // For discriminator sub-schemas, we don't make these fields required in the flattened schema + // They will be conditionally required based on discriminator value at runtime + } + } + } + + return flattenedSchema, nil +} + +// resolveDiscriminatorMapping resolves external schema references from a discriminator mapping +// and returns a slice of schema proxies for all mapped schemas +func resolveDiscriminatorMapping(mapping *orderedmap.Map[string, string], document *high.Document) ([]*base.SchemaProxy, *SchemaError) { + var resolvedProxies []*base.SchemaProxy + + // Iterate through all discriminator mapping entries + for pair := range orderedmap.Iterate(context.TODO(), mapping) { + // discriminatorValue := pair.Key() // e.g., "galaxy", "glue", "hive" + schemaRef := pair.Value() // e.g., "#/components/schemas/S3CatalogGalaxyMetastore" + + // Resolve the schema reference using the document context + resolvedProxy, err := resolveSchemaReference(schemaRef, document) + if err != nil { + // Continue with other mappings if one fails + continue + } + + resolvedProxies = append(resolvedProxies, resolvedProxy) + } + + return resolvedProxies, nil +} + +// resolveSchemaReference resolves a schema reference like "#/components/schemas/SchemaName" +// and returns the corresponding schema proxy +func resolveSchemaReference(reference string, document *high.Document) (*base.SchemaProxy, error) { + // Check if this is a components/schemas reference + if !strings.HasPrefix(reference, "#/components/schemas/") { + return nil, fmt.Errorf("unsupported reference format: %s", reference) + } + + // Extract the schema name from the reference + schemaName := strings.TrimPrefix(reference, "#/components/schemas/") + + // Check if document is provided + if document == nil { + return nil, fmt.Errorf("cannot resolve reference %s: no document provided", reference) + } + + // Look up the schema in the document's components + if document.Components == nil || document.Components.Schemas == nil { + return nil, fmt.Errorf("cannot resolve reference %s: no components/schemas in document", reference) + } + + schemaProxy, exists := document.Components.Schemas.Get(schemaName) + if !exists { + return nil, fmt.Errorf("schema not found: %s", schemaName) + } + + return schemaProxy, nil +} diff --git a/internal/mapper/oas/oas_schema.go b/internal/mapper/oas/oas_schema.go index 29b4ec86..06130b3c 100644 --- a/internal/mapper/oas/oas_schema.go +++ b/internal/mapper/oas/oas_schema.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/schema" "github.com/pb33f/libopenapi/datamodel/high/base" + high "github.com/pb33f/libopenapi/datamodel/high/v3" "github.com/pb33f/libopenapi/orderedmap" ) @@ -31,6 +32,13 @@ type GlobalSchemaOpts struct { // create request for a resource, does not become required from a lower precedence operation, such as an // read response for a resource. OverrideComputability schema.ComputedOptionalRequired + + // Document provides access to the full OpenAPI document for resolving external schema references + // in discriminator mappings (e.g., "#/components/schemas/S3CatalogGalaxyMetastore") + Document *high.Document + + // DiscriminatorDepth tracks recursion depth to prevent infinite loops in discriminator resolution + DiscriminatorDepth int } // SchemaOpts is NOT passed recursively through built OASSchema structs, and will only be available to the top level schema. This is used diff --git a/internal/mapper/provider_mapper.go b/internal/mapper/provider_mapper.go index 7950c7d6..be8ff2cb 100644 --- a/internal/mapper/provider_mapper.go +++ b/internal/mapper/provider_mapper.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/log" "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" + high "github.com/pb33f/libopenapi/datamodel/high/v3" ) var _ ProviderMapper = providerMapper{} @@ -22,13 +23,15 @@ type ProviderMapper interface { type providerMapper struct { provider explorer.Provider + document *high.Document //nolint:unused // Might be useful later! cfg config.Config } -func NewProviderMapper(exploredProvider explorer.Provider, cfg config.Config) ProviderMapper { +func NewProviderMapper(exploredProvider explorer.Provider, document *high.Document, cfg config.Config) ProviderMapper { return providerMapper{ provider: exploredProvider, + document: document, cfg: cfg, } } @@ -44,7 +47,7 @@ func (m providerMapper) MapToIR(logger *slog.Logger) (*provider.Provider, error) pLogger := logger.With("provider", providerIR.Name) - providerSchema, err := generateProviderSchema(pLogger, m.provider) + providerSchema, err := generateProviderSchema(pLogger, m.provider, m.document) if err != nil { return nil, err } @@ -53,13 +56,15 @@ func (m providerMapper) MapToIR(logger *slog.Logger) (*provider.Provider, error) return &providerIR, nil } -func generateProviderSchema(logger *slog.Logger, exploredProvider explorer.Provider) (*provider.Schema, error) { +func generateProviderSchema(logger *slog.Logger, exploredProvider explorer.Provider, document *high.Document) (*provider.Schema, error) { providerSchema := &provider.Schema{} schemaOpts := oas.SchemaOpts{ Ignores: exploredProvider.Ignores, } - s, err := oas.BuildSchema(exploredProvider.SchemaProxy, schemaOpts, oas.GlobalSchemaOpts{}) + s, err := oas.BuildSchema(exploredProvider.SchemaProxy, schemaOpts, oas.GlobalSchemaOpts{ + Document: document, + }) if err != nil { return nil, err } diff --git a/internal/mapper/resource_mapper.go b/internal/mapper/resource_mapper.go index 1b393db2..751da996 100644 --- a/internal/mapper/resource_mapper.go +++ b/internal/mapper/resource_mapper.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" + high "github.com/pb33f/libopenapi/datamodel/high/v3" ) var _ ResourceMapper = resourceMapper{} @@ -25,13 +26,15 @@ type ResourceMapper interface { type resourceMapper struct { resources map[string]explorer.Resource + document *high.Document //nolint:unused // Might be useful later! cfg config.Config } -func NewResourceMapper(resources map[string]explorer.Resource, cfg config.Config) ResourceMapper { +func NewResourceMapper(resources map[string]explorer.Resource, document *high.Document, cfg config.Config) ResourceMapper { return resourceMapper{ resources: resources, + document: document, cfg: cfg, } } @@ -45,7 +48,7 @@ func (m resourceMapper) MapToIR(logger *slog.Logger) ([]resource.Resource, error explorerResource := m.resources[name] rLogger := logger.With("resource", name) - schema, err := generateResourceSchema(rLogger, explorerResource) + schema, err := generateResourceSchema(rLogger, explorerResource, m.document) if err != nil { log.WarnLogOnError(rLogger, err, "skipping resource schema mapping") continue @@ -60,7 +63,7 @@ func (m resourceMapper) MapToIR(logger *slog.Logger) ([]resource.Resource, error return resourceSchemas, nil } -func generateResourceSchema(logger *slog.Logger, explorerResource explorer.Resource) (*resource.Schema, error) { +func generateResourceSchema(logger *slog.Logger, explorerResource explorer.Resource, document *high.Document) (*resource.Schema, error) { resourceSchema := &resource.Schema{ Attributes: []resource.Attribute{}, } @@ -73,7 +76,9 @@ func generateResourceSchema(logger *slog.Logger, explorerResource explorer.Resou schemaOpts := oas.SchemaOpts{ Ignores: explorerResource.SchemaOptions.Ignores, } - createRequestSchema, err := oas.BuildSchemaFromRequest(explorerResource.CreateOp, schemaOpts, oas.GlobalSchemaOpts{}) + createRequestSchema, err := oas.BuildSchemaFromRequest(explorerResource.CreateOp, schemaOpts, oas.GlobalSchemaOpts{ + Document: document, + }) if err != nil { return nil, err } @@ -93,6 +98,7 @@ func generateResourceSchema(logger *slog.Logger, explorerResource explorer.Resou } globalSchemaOpts := oas.GlobalSchemaOpts{ OverrideComputability: schema.Computed, + Document: document, } createResponseSchema, err := oas.BuildSchemaFromResponse(explorerResource.CreateOp, schemaOpts, globalSchemaOpts) if err != nil { @@ -121,6 +127,7 @@ func generateResourceSchema(logger *slog.Logger, explorerResource explorer.Resou } globalSchemaOpts = oas.GlobalSchemaOpts{ OverrideComputability: schema.Computed, + Document: document, } readResponseSchema, err := oas.BuildSchemaFromResponse(explorerResource.ReadOp, schemaOpts, globalSchemaOpts) if err != nil { @@ -151,7 +158,10 @@ func generateResourceSchema(logger *slog.Logger, explorerResource explorer.Resou Ignores: explorerResource.SchemaOptions.Ignores, OverrideDescription: param.Description, } - globalSchemaOpts := oas.GlobalSchemaOpts{OverrideComputability: schema.ComputedOptional} + globalSchemaOpts := oas.GlobalSchemaOpts{ + OverrideComputability: schema.ComputedOptional, + Document: document, + } s, schemaErr := oas.BuildSchema(param.Schema, schemaOpts, globalSchemaOpts) if schemaErr != nil { From a3f0d68033234b7cf5f182d8fb61b21d47778e36 Mon Sep 17 00:00:00 2001 From: BradyBurke <51826266+bradyburke@users.noreply.github.com> Date: Tue, 16 Sep 2025 14:04:12 -0400 Subject: [PATCH 2/2] Update refs to fork --- cmd/tfplugingen-openapi/main.go | 2 +- go.mod | 2 +- internal/cmd/generate.go | 6 +++--- internal/cmd/generate_test.go | 2 +- internal/config/parse_test.go | 2 +- internal/explorer/config_explorer.go | 2 +- internal/explorer/config_explorer_test.go | 4 ++-- internal/explorer/explorer_utils_test.go | 2 +- internal/explorer/guesstimator_explorer_test.go | 2 +- internal/log/warn.go | 2 +- internal/mapper/attrmapper/bool.go | 4 ++-- internal/mapper/attrmapper/bool_test.go | 4 ++-- internal/mapper/attrmapper/data_source_attributes.go | 2 +- .../mapper/attrmapper/data_source_attributes_test.go | 4 ++-- internal/mapper/attrmapper/float64.go | 4 ++-- internal/mapper/attrmapper/float64_test.go | 4 ++-- internal/mapper/attrmapper/int64.go | 4 ++-- internal/mapper/attrmapper/int64_test.go | 4 ++-- internal/mapper/attrmapper/list.go | 4 ++-- internal/mapper/attrmapper/list_nested.go | 4 ++-- internal/mapper/attrmapper/list_nested_test.go | 4 ++-- internal/mapper/attrmapper/list_test.go | 4 ++-- internal/mapper/attrmapper/map.go | 4 ++-- internal/mapper/attrmapper/map_nested.go | 4 ++-- internal/mapper/attrmapper/map_nested_test.go | 4 ++-- internal/mapper/attrmapper/map_test.go | 4 ++-- internal/mapper/attrmapper/number.go | 4 ++-- internal/mapper/attrmapper/number_test.go | 4 ++-- internal/mapper/attrmapper/resource_attributes.go | 2 +- .../mapper/attrmapper/resource_attributes_test.go | 4 ++-- internal/mapper/attrmapper/set.go | 4 ++-- internal/mapper/attrmapper/set_nested.go | 4 ++-- internal/mapper/attrmapper/set_nested_test.go | 4 ++-- internal/mapper/attrmapper/set_test.go | 4 ++-- internal/mapper/attrmapper/single_nested.go | 4 ++-- internal/mapper/attrmapper/single_nested_test.go | 4 ++-- internal/mapper/attrmapper/string.go | 4 ++-- internal/mapper/attrmapper/string_test.go | 4 ++-- internal/mapper/attrmapper/types.go | 2 +- internal/mapper/datasource_mapper.go | 12 ++++++------ internal/mapper/datasource_mapper_test.go | 8 ++++---- .../frameworkvalidators/float64validator_test.go | 2 +- .../frameworkvalidators/int64validator_test.go | 2 +- .../mapper/frameworkvalidators/listvalidator_test.go | 2 +- .../mapper/frameworkvalidators/mapvalidator_test.go | 2 +- .../mapper/frameworkvalidators/setvalidator_test.go | 2 +- .../frameworkvalidators/stringvalidator_test.go | 2 +- internal/mapper/oas/attribute.go | 4 ++-- internal/mapper/oas/bool.go | 2 +- internal/mapper/oas/bool_test.go | 4 ++-- internal/mapper/oas/build.go | 4 ++-- internal/mapper/oas/build_test.go | 4 ++-- internal/mapper/oas/collection.go | 6 +++--- internal/mapper/oas/collection_test.go | 4 ++-- internal/mapper/oas/element_type.go | 2 +- internal/mapper/oas/integer.go | 4 ++-- internal/mapper/oas/integer_test.go | 4 ++-- internal/mapper/oas/map.go | 6 +++--- internal/mapper/oas/map_test.go | 4 ++-- internal/mapper/oas/number.go | 6 +++--- internal/mapper/oas/number_test.go | 4 ++-- internal/mapper/oas/oas_schema.go | 2 +- internal/mapper/oas/oas_schema_test.go | 2 +- internal/mapper/oas/object.go | 2 +- internal/mapper/oas/single_nested.go | 2 +- internal/mapper/oas/single_nested_test.go | 4 ++-- internal/mapper/oas/string.go | 4 ++-- internal/mapper/oas/string_test.go | 4 ++-- internal/mapper/provider_mapper.go | 8 ++++---- internal/mapper/provider_mapper_test.go | 8 ++++---- internal/mapper/resource_mapper.go | 12 ++++++------ internal/mapper/resource_mapper_test.go | 8 ++++---- internal/mapper/util/framework_identifier_test.go | 2 +- 73 files changed, 142 insertions(+), 142 deletions(-) diff --git a/cmd/tfplugingen-openapi/main.go b/cmd/tfplugingen-openapi/main.go index e9288cf4..06d8ea66 100644 --- a/cmd/tfplugingen-openapi/main.go +++ b/cmd/tfplugingen-openapi/main.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/cli" "github.com/mattn/go-colorable" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/cmd" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/cmd" ) // version will be set by goreleaser via ldflags diff --git a/go.mod b/go.mod index b0070fe1..bad4e043 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/hashicorp/terraform-plugin-codegen-openapi +module github.com/starburstdata/terraform-plugin-codegen-openapi go 1.23.0 diff --git a/internal/cmd/generate.go b/internal/cmd/generate.go index 6ab364b4..0afcccf5 100644 --- a/internal/cmd/generate.go +++ b/internal/cmd/generate.go @@ -13,9 +13,9 @@ import ( "os" "strings" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/config" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/config" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper" "github.com/hashicorp/terraform-plugin-codegen-spec/spec" "github.com/hashicorp/cli" diff --git a/internal/cmd/generate_test.go b/internal/cmd/generate_test.go index 9327490e..7a534915 100644 --- a/internal/cmd/generate_test.go +++ b/internal/cmd/generate_test.go @@ -11,7 +11,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/hashicorp/cli" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/cmd" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/cmd" ) func TestGenerate_WithConfig(t *testing.T) { diff --git a/internal/config/parse_test.go b/internal/config/parse_test.go index f15104d1..664cf53b 100644 --- a/internal/config/parse_test.go +++ b/internal/config/parse_test.go @@ -7,7 +7,7 @@ import ( "regexp" "testing" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/config" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/config" ) func TestParseConfig_Valid(t *testing.T) { diff --git a/internal/explorer/config_explorer.go b/internal/explorer/config_explorer.go index cc5fa13d..8ee8392a 100644 --- a/internal/explorer/config_explorer.go +++ b/internal/explorer/config_explorer.go @@ -9,7 +9,7 @@ import ( "fmt" "strings" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/config" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/config" highbase "github.com/pb33f/libopenapi/datamodel/high/base" high "github.com/pb33f/libopenapi/datamodel/high/v3" diff --git a/internal/explorer/config_explorer_test.go b/internal/explorer/config_explorer_test.go index d929c6f8..a30b0173 100644 --- a/internal/explorer/config_explorer_test.go +++ b/internal/explorer/config_explorer_test.go @@ -10,8 +10,8 @@ import ( "gopkg.in/yaml.v3" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/config" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/config" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" diff --git a/internal/explorer/explorer_utils_test.go b/internal/explorer/explorer_utils_test.go index 41519efa..e954df51 100644 --- a/internal/explorer/explorer_utils_test.go +++ b/internal/explorer/explorer_utils_test.go @@ -12,7 +12,7 @@ import ( "github.com/pb33f/libopenapi/datamodel/high/base" high "github.com/pb33f/libopenapi/datamodel/high/v3" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" ) func TestReadOpParameters_Resource(t *testing.T) { diff --git a/internal/explorer/guesstimator_explorer_test.go b/internal/explorer/guesstimator_explorer_test.go index 9ac60b29..8d490716 100644 --- a/internal/explorer/guesstimator_explorer_test.go +++ b/internal/explorer/guesstimator_explorer_test.go @@ -6,7 +6,7 @@ package explorer_test import ( "testing" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" high "github.com/pb33f/libopenapi/datamodel/high/v3" "github.com/pb33f/libopenapi/orderedmap" diff --git a/internal/log/warn.go b/internal/log/warn.go index fee60f2f..14062b94 100644 --- a/internal/log/warn.go +++ b/internal/log/warn.go @@ -7,7 +7,7 @@ import ( "errors" "log/slog" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" ) // WarnLogOnError inspects the error type and extracts additional information for structured logging if possible diff --git a/internal/mapper/attrmapper/bool.go b/internal/mapper/attrmapper/bool.go index 7b6fb922..d8641521 100644 --- a/internal/mapper/attrmapper/bool.go +++ b/internal/mapper/attrmapper/bool.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/bool_test.go b/internal/mapper/attrmapper/bool_test.go index a9ba5b0f..620d67e0 100644 --- a/internal/mapper/attrmapper/bool_test.go +++ b/internal/mapper/attrmapper/bool_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceBoolAttribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/data_source_attributes.go b/internal/mapper/attrmapper/data_source_attributes.go index e1dc435e..70730acc 100644 --- a/internal/mapper/attrmapper/data_source_attributes.go +++ b/internal/mapper/attrmapper/data_source_attributes.go @@ -7,7 +7,7 @@ import ( "errors" "strings" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" ) diff --git a/internal/mapper/attrmapper/data_source_attributes_test.go b/internal/mapper/attrmapper/data_source_attributes_test.go index 1535d9bd..9a4b1f02 100644 --- a/internal/mapper/attrmapper/data_source_attributes_test.go +++ b/internal/mapper/attrmapper/data_source_attributes_test.go @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestDataSourceAttributes_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/float64.go b/internal/mapper/attrmapper/float64.go index 7a6680cd..0050f521 100644 --- a/internal/mapper/attrmapper/float64.go +++ b/internal/mapper/attrmapper/float64.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/float64_test.go b/internal/mapper/attrmapper/float64_test.go index 71e9bcd9..9cacaa3e 100644 --- a/internal/mapper/attrmapper/float64_test.go +++ b/internal/mapper/attrmapper/float64_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceFloat64Attribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/int64.go b/internal/mapper/attrmapper/int64.go index 0c0fe758..03e687de 100644 --- a/internal/mapper/attrmapper/int64.go +++ b/internal/mapper/attrmapper/int64.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/int64_test.go b/internal/mapper/attrmapper/int64_test.go index a3300447..4a8dbc03 100644 --- a/internal/mapper/attrmapper/int64_test.go +++ b/internal/mapper/attrmapper/int64_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceInt64Attribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/list.go b/internal/mapper/attrmapper/list.go index 2a1c0eb8..cd077120 100644 --- a/internal/mapper/attrmapper/list.go +++ b/internal/mapper/attrmapper/list.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/list_nested.go b/internal/mapper/attrmapper/list_nested.go index 68e07375..61eb9b84 100644 --- a/internal/mapper/attrmapper/list_nested.go +++ b/internal/mapper/attrmapper/list_nested.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/list_nested_test.go b/internal/mapper/attrmapper/list_nested_test.go index 51dcf5d9..7706f92a 100644 --- a/internal/mapper/attrmapper/list_nested_test.go +++ b/internal/mapper/attrmapper/list_nested_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceListNestedAttribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/list_test.go b/internal/mapper/attrmapper/list_test.go index 515b8c18..11b3b956 100644 --- a/internal/mapper/attrmapper/list_test.go +++ b/internal/mapper/attrmapper/list_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceListAttribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/map.go b/internal/mapper/attrmapper/map.go index f25c8a59..1556ded0 100644 --- a/internal/mapper/attrmapper/map.go +++ b/internal/mapper/attrmapper/map.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/map_nested.go b/internal/mapper/attrmapper/map_nested.go index 4ba7f40a..1d37eab1 100644 --- a/internal/mapper/attrmapper/map_nested.go +++ b/internal/mapper/attrmapper/map_nested.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/map_nested_test.go b/internal/mapper/attrmapper/map_nested_test.go index b9fd8406..55c4b3cd 100644 --- a/internal/mapper/attrmapper/map_nested_test.go +++ b/internal/mapper/attrmapper/map_nested_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceMapNestedAttribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/map_test.go b/internal/mapper/attrmapper/map_test.go index 35e7a0a3..27552421 100644 --- a/internal/mapper/attrmapper/map_test.go +++ b/internal/mapper/attrmapper/map_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceMapAttribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/number.go b/internal/mapper/attrmapper/number.go index f47b8da9..1c192db6 100644 --- a/internal/mapper/attrmapper/number.go +++ b/internal/mapper/attrmapper/number.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/number_test.go b/internal/mapper/attrmapper/number_test.go index 295c69c2..794453a0 100644 --- a/internal/mapper/attrmapper/number_test.go +++ b/internal/mapper/attrmapper/number_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceNumberAttribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/resource_attributes.go b/internal/mapper/attrmapper/resource_attributes.go index 6c772c26..205191fe 100644 --- a/internal/mapper/attrmapper/resource_attributes.go +++ b/internal/mapper/attrmapper/resource_attributes.go @@ -7,7 +7,7 @@ import ( "errors" "strings" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" ) diff --git a/internal/mapper/attrmapper/resource_attributes_test.go b/internal/mapper/attrmapper/resource_attributes_test.go index 45d0be90..dd2a3a51 100644 --- a/internal/mapper/attrmapper/resource_attributes_test.go +++ b/internal/mapper/attrmapper/resource_attributes_test.go @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceAttributes_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/set.go b/internal/mapper/attrmapper/set.go index a1c031b7..6c025d8c 100644 --- a/internal/mapper/attrmapper/set.go +++ b/internal/mapper/attrmapper/set.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/set_nested.go b/internal/mapper/attrmapper/set_nested.go index 082a61ef..00e02ba7 100644 --- a/internal/mapper/attrmapper/set_nested.go +++ b/internal/mapper/attrmapper/set_nested.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/set_nested_test.go b/internal/mapper/attrmapper/set_nested_test.go index 639a4f1c..0417db3c 100644 --- a/internal/mapper/attrmapper/set_nested_test.go +++ b/internal/mapper/attrmapper/set_nested_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceSetNestedAttribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/set_test.go b/internal/mapper/attrmapper/set_test.go index f3dcbb75..c2e10666 100644 --- a/internal/mapper/attrmapper/set_test.go +++ b/internal/mapper/attrmapper/set_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceSetAttribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/single_nested.go b/internal/mapper/attrmapper/single_nested.go index e83f1055..d2eb3060 100644 --- a/internal/mapper/attrmapper/single_nested.go +++ b/internal/mapper/attrmapper/single_nested.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/single_nested_test.go b/internal/mapper/attrmapper/single_nested_test.go index 3642fa88..e4c1422c 100644 --- a/internal/mapper/attrmapper/single_nested_test.go +++ b/internal/mapper/attrmapper/single_nested_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceSingleNestedAttribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/string.go b/internal/mapper/attrmapper/string.go index fc54a6ab..141d6509 100644 --- a/internal/mapper/attrmapper/string.go +++ b/internal/mapper/attrmapper/string.go @@ -4,8 +4,8 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/attrmapper/string_test.go b/internal/mapper/attrmapper/string_test.go index 6781f505..b9de4a39 100644 --- a/internal/mapper/attrmapper/string_test.go +++ b/internal/mapper/attrmapper/string_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" ) func TestResourceStringAttribute_Merge(t *testing.T) { diff --git a/internal/mapper/attrmapper/types.go b/internal/mapper/attrmapper/types.go index ea2d4eb4..983ddff9 100644 --- a/internal/mapper/attrmapper/types.go +++ b/internal/mapper/attrmapper/types.go @@ -4,7 +4,7 @@ package attrmapper import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" ) diff --git a/internal/mapper/datasource_mapper.go b/internal/mapper/datasource_mapper.go index e49d1510..c785c640 100644 --- a/internal/mapper/datasource_mapper.go +++ b/internal/mapper/datasource_mapper.go @@ -7,12 +7,12 @@ import ( "fmt" "log/slog" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/config" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/log" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/config" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/log" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" high "github.com/pb33f/libopenapi/datamodel/high/v3" diff --git a/internal/mapper/datasource_mapper_test.go b/internal/mapper/datasource_mapper_test.go index e2edc84b..c5de984d 100644 --- a/internal/mapper/datasource_mapper_test.go +++ b/internal/mapper/datasource_mapper_test.go @@ -10,10 +10,10 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/config" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/config" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/google/go-cmp/cmp" "github.com/pb33f/libopenapi/datamodel/high/base" diff --git a/internal/mapper/frameworkvalidators/float64validator_test.go b/internal/mapper/frameworkvalidators/float64validator_test.go index 126e8ac3..7bb35e64 100644 --- a/internal/mapper/frameworkvalidators/float64validator_test.go +++ b/internal/mapper/frameworkvalidators/float64validator_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/code" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" ) func TestFloat64ValidatorOneOf(t *testing.T) { diff --git a/internal/mapper/frameworkvalidators/int64validator_test.go b/internal/mapper/frameworkvalidators/int64validator_test.go index 26c7cd9e..6bc75d17 100644 --- a/internal/mapper/frameworkvalidators/int64validator_test.go +++ b/internal/mapper/frameworkvalidators/int64validator_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/code" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" ) func TestInt64ValidatorAtLeast(t *testing.T) { diff --git a/internal/mapper/frameworkvalidators/listvalidator_test.go b/internal/mapper/frameworkvalidators/listvalidator_test.go index 78ec71a5..2de3c53f 100644 --- a/internal/mapper/frameworkvalidators/listvalidator_test.go +++ b/internal/mapper/frameworkvalidators/listvalidator_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/code" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" ) func TestListValidatorSizeAtLeast(t *testing.T) { diff --git a/internal/mapper/frameworkvalidators/mapvalidator_test.go b/internal/mapper/frameworkvalidators/mapvalidator_test.go index ee41b4bb..54d2bac6 100644 --- a/internal/mapper/frameworkvalidators/mapvalidator_test.go +++ b/internal/mapper/frameworkvalidators/mapvalidator_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/code" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" ) func TestMapValidatorSizeAtLeast(t *testing.T) { diff --git a/internal/mapper/frameworkvalidators/setvalidator_test.go b/internal/mapper/frameworkvalidators/setvalidator_test.go index af0e0976..9fbd27da 100644 --- a/internal/mapper/frameworkvalidators/setvalidator_test.go +++ b/internal/mapper/frameworkvalidators/setvalidator_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/code" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" ) func TestSetValidatorSizeAtLeast(t *testing.T) { diff --git a/internal/mapper/frameworkvalidators/stringvalidator_test.go b/internal/mapper/frameworkvalidators/stringvalidator_test.go index 41c4089d..88b3cf28 100644 --- a/internal/mapper/frameworkvalidators/stringvalidator_test.go +++ b/internal/mapper/frameworkvalidators/stringvalidator_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/code" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" ) func TestStringValidatorLengthAtLeast(t *testing.T) { diff --git a/internal/mapper/oas/attribute.go b/internal/mapper/oas/attribute.go index d0464b60..2a1f6a44 100644 --- a/internal/mapper/oas/attribute.go +++ b/internal/mapper/oas/attribute.go @@ -7,8 +7,8 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" "github.com/pb33f/libopenapi/orderedmap" ) diff --git a/internal/mapper/oas/bool.go b/internal/mapper/oas/bool.go index fe69e7fa..b1e72241 100644 --- a/internal/mapper/oas/bool.go +++ b/internal/mapper/oas/bool.go @@ -4,7 +4,7 @@ package oas import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/oas/bool_test.go b/internal/mapper/oas/bool_test.go index e99dfee2..ea00397a 100644 --- a/internal/mapper/oas/bool_test.go +++ b/internal/mapper/oas/bool_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/schema" "gopkg.in/yaml.v3" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" "github.com/google/go-cmp/cmp" "github.com/pb33f/libopenapi/datamodel/high/base" diff --git a/internal/mapper/oas/build.go b/internal/mapper/oas/build.go index d0ab3695..c077217d 100644 --- a/internal/mapper/oas/build.go +++ b/internal/mapper/oas/build.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/pb33f/libopenapi/datamodel/high/base" high "github.com/pb33f/libopenapi/datamodel/high/v3" @@ -257,7 +257,7 @@ func retrieveType(schema *base.Schema) (string, *SchemaError) { switch len(schema.Type) { case 0: // Properties are only valid applying to objects, it's possible tools might omit the type - // https://github.com/hashicorp/terraform-plugin-codegen-openapi/issues/79 + // https://github.com/starburstdata/terraform-plugin-codegen-openapi/issues/79 if schema.Properties != nil && schema.Properties.Len() > 0 { return util.OAS_type_object, nil } diff --git a/internal/mapper/oas/build_test.go b/internal/mapper/oas/build_test.go index de83bc31..095e6f4d 100644 --- a/internal/mapper/oas/build_test.go +++ b/internal/mapper/oas/build_test.go @@ -10,8 +10,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" diff --git a/internal/mapper/oas/collection.go b/internal/mapper/oas/collection.go index 6fe41dc1..bf0dc5e2 100644 --- a/internal/mapper/oas/collection.go +++ b/internal/mapper/oas/collection.go @@ -6,9 +6,9 @@ package oas import ( "errors" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/oas/collection_test.go b/internal/mapper/oas/collection_test.go index 66122492..e2f4d82a 100644 --- a/internal/mapper/oas/collection_test.go +++ b/internal/mapper/oas/collection_test.go @@ -12,8 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" "github.com/google/go-cmp/cmp" "github.com/pb33f/libopenapi/datamodel/high/base" diff --git a/internal/mapper/oas/element_type.go b/internal/mapper/oas/element_type.go index a951cdc7..5dee210c 100644 --- a/internal/mapper/oas/element_type.go +++ b/internal/mapper/oas/element_type.go @@ -6,7 +6,7 @@ package oas import ( "fmt" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" ) diff --git a/internal/mapper/oas/integer.go b/internal/mapper/oas/integer.go index c7544f8d..d4084db5 100644 --- a/internal/mapper/oas/integer.go +++ b/internal/mapper/oas/integer.go @@ -4,8 +4,8 @@ package oas import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/oas/integer_test.go b/internal/mapper/oas/integer_test.go index 11ee720c..6bf92703 100644 --- a/internal/mapper/oas/integer_test.go +++ b/internal/mapper/oas/integer_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/schema" "gopkg.in/yaml.v3" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" "github.com/google/go-cmp/cmp" "github.com/pb33f/libopenapi/datamodel/high/base" diff --git a/internal/mapper/oas/map.go b/internal/mapper/oas/map.go index 2498b4f4..2bda14ce 100644 --- a/internal/mapper/oas/map.go +++ b/internal/mapper/oas/map.go @@ -6,9 +6,9 @@ package oas import ( "errors" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/oas/map_test.go b/internal/mapper/oas/map_test.go index dc9776cb..7e92351e 100644 --- a/internal/mapper/oas/map_test.go +++ b/internal/mapper/oas/map_test.go @@ -15,8 +15,8 @@ import ( "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/pb33f/libopenapi/orderedmap" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" ) // TODO: add error tests diff --git a/internal/mapper/oas/number.go b/internal/mapper/oas/number.go index 1feec3a4..c48344cc 100644 --- a/internal/mapper/oas/number.go +++ b/internal/mapper/oas/number.go @@ -4,9 +4,9 @@ package oas import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/oas/number_test.go b/internal/mapper/oas/number_test.go index 2b70a56f..e08559b6 100644 --- a/internal/mapper/oas/number_test.go +++ b/internal/mapper/oas/number_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/schema" "gopkg.in/yaml.v3" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" "github.com/google/go-cmp/cmp" "github.com/pb33f/libopenapi/datamodel/high/base" diff --git a/internal/mapper/oas/oas_schema.go b/internal/mapper/oas/oas_schema.go index 06130b3c..a81e0113 100644 --- a/internal/mapper/oas/oas_schema.go +++ b/internal/mapper/oas/oas_schema.go @@ -7,7 +7,7 @@ import ( "context" "strings" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" "github.com/pb33f/libopenapi/datamodel/high/base" diff --git a/internal/mapper/oas/oas_schema_test.go b/internal/mapper/oas/oas_schema_test.go index e8e99551..c341c0c3 100644 --- a/internal/mapper/oas/oas_schema_test.go +++ b/internal/mapper/oas/oas_schema_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/pb33f/libopenapi/datamodel/high/base" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" ) func pointer[T any](value T) *T { diff --git a/internal/mapper/oas/object.go b/internal/mapper/oas/object.go index 48072675..c82654cd 100644 --- a/internal/mapper/oas/object.go +++ b/internal/mapper/oas/object.go @@ -6,7 +6,7 @@ package oas import ( "context" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" "github.com/pb33f/libopenapi/orderedmap" ) diff --git a/internal/mapper/oas/single_nested.go b/internal/mapper/oas/single_nested.go index f41790df..8b7db2a0 100644 --- a/internal/mapper/oas/single_nested.go +++ b/internal/mapper/oas/single_nested.go @@ -4,7 +4,7 @@ package oas import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/oas/single_nested_test.go b/internal/mapper/oas/single_nested_test.go index b1063313..2c7899fb 100644 --- a/internal/mapper/oas/single_nested_test.go +++ b/internal/mapper/oas/single_nested_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" "github.com/google/go-cmp/cmp" "github.com/pb33f/libopenapi/datamodel/high/base" diff --git a/internal/mapper/oas/string.go b/internal/mapper/oas/string.go index 3cd96aac..1a6a8a66 100644 --- a/internal/mapper/oas/string.go +++ b/internal/mapper/oas/string.go @@ -4,8 +4,8 @@ package oas import ( - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/frameworkvalidators" "github.com/hashicorp/terraform-plugin-codegen-spec/datasource" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" diff --git a/internal/mapper/oas/string_test.go b/internal/mapper/oas/string_test.go index 0d2df4cf..84464731 100644 --- a/internal/mapper/oas/string_test.go +++ b/internal/mapper/oas/string_test.go @@ -13,8 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/schema" "gopkg.in/yaml.v3" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" "github.com/google/go-cmp/cmp" "github.com/pb33f/libopenapi/datamodel/high/base" diff --git a/internal/mapper/provider_mapper.go b/internal/mapper/provider_mapper.go index be8ff2cb..d2b89a11 100644 --- a/internal/mapper/provider_mapper.go +++ b/internal/mapper/provider_mapper.go @@ -7,10 +7,10 @@ import ( "fmt" "log/slog" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/config" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/log" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/config" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/log" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" "github.com/hashicorp/terraform-plugin-codegen-spec/provider" high "github.com/pb33f/libopenapi/datamodel/high/v3" ) diff --git a/internal/mapper/provider_mapper_test.go b/internal/mapper/provider_mapper_test.go index 8b030372..267ffa6e 100644 --- a/internal/mapper/provider_mapper_test.go +++ b/internal/mapper/provider_mapper_test.go @@ -13,10 +13,10 @@ import ( "github.com/pb33f/libopenapi/datamodel/high/base" "github.com/pb33f/libopenapi/orderedmap" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/config" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/config" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" ) func TestProviderMapper_basic(t *testing.T) { diff --git a/internal/mapper/resource_mapper.go b/internal/mapper/resource_mapper.go index 751da996..757ea774 100644 --- a/internal/mapper/resource_mapper.go +++ b/internal/mapper/resource_mapper.go @@ -7,12 +7,12 @@ import ( "errors" "log/slog" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/config" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/log" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/oas" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/config" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/log" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/attrmapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/oas" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" high "github.com/pb33f/libopenapi/datamodel/high/v3" diff --git a/internal/mapper/resource_mapper_test.go b/internal/mapper/resource_mapper_test.go index 6608873b..951dd80a 100644 --- a/internal/mapper/resource_mapper_test.go +++ b/internal/mapper/resource_mapper_test.go @@ -10,10 +10,10 @@ import ( "github.com/hashicorp/terraform-plugin-codegen-spec/resource" "github.com/hashicorp/terraform-plugin-codegen-spec/schema" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/config" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/explorer" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/config" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/explorer" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" "github.com/google/go-cmp/cmp" "github.com/pb33f/libopenapi/datamodel/high/base" diff --git a/internal/mapper/util/framework_identifier_test.go b/internal/mapper/util/framework_identifier_test.go index 35dc031e..efed0ca9 100644 --- a/internal/mapper/util/framework_identifier_test.go +++ b/internal/mapper/util/framework_identifier_test.go @@ -6,7 +6,7 @@ package util_test import ( "testing" - "github.com/hashicorp/terraform-plugin-codegen-openapi/internal/mapper/util" + "github.com/starburstdata/terraform-plugin-codegen-openapi/internal/mapper/util" ) func TestFrameworkIdentifier(t *testing.T) {