Skip to content

Commit

Permalink
private/model/api: Fix RESTXML support for XML Namespace
Browse files Browse the repository at this point in the history
Fixes a bug with the SDK's generation of services using the REST XML
protocol not annotating shape references with the XML Namespace
attribute.

Fix aws#1334
  • Loading branch information
jasdel committed Jun 13, 2017
1 parent daa2671 commit 4122150
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 41 deletions.
11 changes: 6 additions & 5 deletions private/model/api/shape.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,12 @@ func (ref *ShapeRef) GoTags(toplevel bool, isRequired bool) string {
} else if ref.Shape.XMLNamespace.Prefix != "" {
tags = append(tags, ShapeTag{"xmlPrefix", ref.Shape.XMLNamespace.Prefix})
}
if ref.XMLNamespace.URI != "" {
tags = append(tags, ShapeTag{"xmlURI", ref.XMLNamespace.URI})
} else if ref.Shape.XMLNamespace.URI != "" {
tags = append(tags, ShapeTag{"xmlURI", ref.Shape.XMLNamespace.URI})
}
}

if ref.XMLNamespace.URI != "" {
tags = append(tags, ShapeTag{"xmlURI", ref.XMLNamespace.URI})
} else if ref.Shape.XMLNamespace.URI != "" {
tags = append(tags, ShapeTag{"xmlURI", ref.Shape.XMLNamespace.URI})
}

if ref.IdempotencyToken || ref.Shape.IdempotencyToken {
Expand Down
2 changes: 1 addition & 1 deletion private/protocol/restxml/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3586,7 +3586,7 @@ func (c *InputService19ProtocolTest) InputService19TestCaseOperation1WithContext
type InputService19TestShapeGrant struct {
_ struct{} `locationName:"Grant" type:"structure"`

Grantee *InputService19TestShapeGrantee `type:"structure"`
Grantee *InputService19TestShapeGrantee `type:"structure" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"`
}

// SetGrantee sets the Grantee field's value.
Expand Down
22 changes: 11 additions & 11 deletions service/cloudfront/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 24 additions & 24 deletions service/s3/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4122150

Please sign in to comment.