Skip to content

Commit

Permalink
reverts change that disabled current impl of gen marshalers for rest-…
Browse files Browse the repository at this point in the history
…xml, rest-json
  • Loading branch information
skotambkar committed Nov 29, 2019
1 parent 9d26715 commit 773f55c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions private/model/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand All @@ -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
}
Expand Down
10 changes: 5 additions & 5 deletions private/model/api/customization_passes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 773f55c

Please sign in to comment.