From 046e87c7abc6693f437333ff0256a13095729b15 Mon Sep 17 00:00:00 2001 From: Tom Bamford Date: Mon, 23 Sep 2024 14:56:39 +0100 Subject: [PATCH] generator-go-sdk: ensure allowOmittingDiscriminatedValue is set correctly for common types --- .../internal/generator/data.go | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/tools/generator-go-sdk/internal/generator/data.go b/tools/generator-go-sdk/internal/generator/data.go index b8e9d086965..28b118a8a1b 100644 --- a/tools/generator-go-sdk/internal/generator/data.go +++ b/tools/generator-go-sdk/internal/generator/data.go @@ -168,22 +168,23 @@ func (i VersionGeneratorInput) generatorData(settings Settings) VersionGenerator return VersionGeneratorData{ GeneratorData: GeneratorData{ - apiVersion: i.VersionName, - canonicalApiVersion: settings.CanonicalApiVersion(i.VersionName), - baseClientPackage: baseClientPackageForSdk(i.Type), - commonTypes: i.CommonTypes, - constants: i.CommonTypes.Constants, - generateDescriptionsForModels: settings.GenerateDescriptionsForModels, - isDataPlane: models.SourceDataTypeIsDataPlane(i.Type), - models: i.CommonTypes.Models, - packageName: versionPackageName, - recurseParentModels: settings.RecurseParentModels, - servicePackageName: strings.ToLower(i.ServiceName), - source: i.Source, - sourceType: i.Type, - useNewBaseLayer: useNewBaseLayer, - versionDirectoryName: versionDirectoryName, - versionPackageName: versionPackageName, + apiVersion: i.VersionName, + canonicalApiVersion: settings.CanonicalApiVersion(i.VersionName), + baseClientPackage: baseClientPackageForSdk(i.Type), + commonTypes: i.CommonTypes, + constants: i.CommonTypes.Constants, + allowOmittingDiscriminatedValue: settings.AllowOmittingDiscriminatedValue, + generateDescriptionsForModels: settings.GenerateDescriptionsForModels, + isDataPlane: models.SourceDataTypeIsDataPlane(i.Type), + models: i.CommonTypes.Models, + packageName: versionPackageName, + recurseParentModels: settings.RecurseParentModels, + servicePackageName: strings.ToLower(i.ServiceName), + source: i.Source, + sourceType: i.Type, + useNewBaseLayer: useNewBaseLayer, + versionDirectoryName: versionDirectoryName, + versionPackageName: versionPackageName, }, commonTypesOutputPath: commonTypesOutputPath, resources: i.Resources,