From 773f55c1e96c798840940c36838927888d4c5396 Mon Sep 17 00:00:00 2001 From: skotambkar Date: Fri, 29 Nov 2019 15:25:09 -0800 Subject: [PATCH] reverts change that disabled current impl of gen marshalers for rest-xml, rest-json --- private/model/api/api.go | 9 ++++----- private/model/api/customization_passes.go | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/private/model/api/api.go b/private/model/api/api.go index a50dc39ff6d..541316c5978 100644 --- a/private/model/api/api.go +++ b/private/model/api/api.go @@ -305,7 +305,7 @@ func (a *API) APIGoCode() string { a.AddSDKImport("private/protocol") } if !a.NoGenMarshalers || !a.NoGenUnmarshalers { - a.AddSDKImport("private/protocol") + a.imports[path.Join(SDKImportRoot, "private/protocol")] = true } var buf bytes.Buffer @@ -330,9 +330,6 @@ func (a *API) APIOperationGoCode(op *Operation) string { a.AddSDKImport("private/protocol", a.ProtocolPackage()) a.AddSDKImport("private/protocol") } - if !a.NoGenMarshalers || !a.NoGenUnmarshalers { - a.AddSDKImport("private/protocol") - } // Need to generate code before imports are generated. code := op.GoCode() @@ -344,7 +341,9 @@ func (a *API) APIOperationGoCode(op *Operation) string { func (a *API) APIOperationTypeGoCode(op *Operation) string { a.resetImports() a.AddSDKImport("internal/awsutil") - + if !a.NoGenMarshalers || !a.NoGenUnmarshalers { + a.imports[path.Join(SDKImportRoot, "private/protocol")] = true + } code := op.IOGoCode() return a.importsGoCode() + code } diff --git a/private/model/api/customization_passes.go b/private/model/api/customization_passes.go index 5292c2453c1..a3611f21f3b 100644 --- a/private/model/api/customization_passes.go +++ b/private/model/api/customization_passes.go @@ -18,15 +18,15 @@ type service struct { } func (a *API) EnableSelectGeneratedMarshalers() { - // Selectivily enable generated marshalers as available + // Selectively enable generated marshalers as available a.NoGenMarshalers = true a.NoGenUnmarshalers = true // Enable generated marshalers - // switch a.Metadata.Protocol { - // case "rest-xml", "rest-json": - // a.NoGenMarshalers = false - // } + switch a.Metadata.Protocol { + case "rest-xml", "rest-json": + a.NoGenMarshalers = false + } } // customizationPasses Executes customization logic for the API by package name.