From 1e724ccf080493c5b319a83ba7624c8142c2c305 Mon Sep 17 00:00:00 2001 From: Noah Dietz Date: Mon, 10 Apr 2023 22:39:31 +0000 Subject: [PATCH] chore(genrest): fix casing for body field --- util/genrest/gomodelcreator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/genrest/gomodelcreator.go b/util/genrest/gomodelcreator.go index 9897122ef..0c2959d28 100644 --- a/util/genrest/gomodelcreator.go +++ b/util/genrest/gomodelcreator.go @@ -16,12 +16,12 @@ package genrest import ( "fmt" - "strings" "github.com/golang/protobuf/protoc-gen-go/descriptor" "github.com/googleapis/gapic-showcase/util/genrest/gomodel" "github.com/googleapis/gapic-showcase/util/genrest/internal/pbinfo" "github.com/googleapis/gapic-showcase/util/genrest/protomodel" + "github.com/iancoleman/strcase" "google.golang.org/protobuf/types/descriptorpb" ) @@ -84,7 +84,7 @@ func NewGoModel(protoModel *protomodel.Model) (*gomodel.Model, error) { requestBodyFieldType, bodyFieldImports, err = protoInfo.NameSpec(bodyFieldTypeDesc) // TODO: test for HTTP body encoding a single field whose names is different than its type // TODO: Test for HTTP body encoding a single field that is a scalar, not a message - requestBodyFieldName = strings.Title(bodyFieldDesc.GetName()) + requestBodyFieldName = strcase.ToCamel(bodyFieldDesc.GetName()) goModel.AccumulateError(err) }