Skip to content

Commit 0fd367c

Browse files
committed
use Operation.ExportedName not Operation.Name
This was a nasty issue to troubleshoot. :( Turns out that for REST+XML-based APIs (such as CloudFront), the aws-sdk-go `private/model/api.Operation` objects have a `Name` field that contains crap like this: "CreateCachePolicy2020_05_31". What this means is that when looking up things like output wrapper field paths by the `Operation.Name` of "CreateCachePolicy" (from the `generator.yaml` file's `operations` map), things were failing because the `private/model/api.API:Operations` map is actually keyed by `Operation.ExportedName`, not `Operation.Name`. `Operation.ExportedName` for REST+XML APIs like CloudFront contain the proper string "CreateCachePolicy" without the date suffix. Signed-off-by: Jay Pipes <jaypipes@gmail.com>
1 parent 9fbf8c4 commit 0fd367c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/config/operation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (c *Config) OperationIsIgnored(operation *awssdkmodel.Operation) bool {
5656
if operation == nil {
5757
return true
5858
}
59-
return util.InStrings(operation.Name, c.Ignore.Operations)
59+
return util.InStrings(operation.ExportedName, c.Ignore.Operations)
6060
}
6161

6262
// UnmarshalJSON parses input for a either a string or
@@ -88,7 +88,7 @@ func (c *Config) GetOutputWrapperFieldPath(
8888
if c == nil {
8989
return nil
9090
}
91-
opConfig, found := c.Operations[op.Name]
91+
opConfig, found := c.Operations[op.ExportedName]
9292
if !found {
9393
return nil
9494
}
@@ -111,7 +111,7 @@ func (c *Config) GetSetOutputCustomMethodName(
111111
if c == nil {
112112
return nil
113113
}
114-
opConfig, found := c.Operations[op.Name]
114+
opConfig, found := c.Operations[op.ExportedName]
115115
if !found {
116116
return nil
117117
}

0 commit comments

Comments
 (0)