Skip to content

Commit fe3a0fd

Browse files
committed
revert hostLabel change
1 parent 63f6a01 commit fe3a0fd

File tree

4 files changed

+2
-28
lines changed

4 files changed

+2
-28
lines changed

codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/protocols/awsjson/AWSJSON1_0ProtocolGenerator.kt

-5
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ import software.amazon.smithy.model.shapes.MemberShape
1212
import software.amazon.smithy.model.shapes.OperationShape
1313
import software.amazon.smithy.model.shapes.Shape
1414
import software.amazon.smithy.model.shapes.ShapeId
15-
import software.amazon.smithy.model.traits.HostLabelTrait
1615
import software.amazon.smithy.swift.codegen.integration.HttpBindingResolver
1716
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
1817
import software.amazon.smithy.swift.codegen.integration.isEventStreaming
1918
import software.amazon.smithy.swift.codegen.integration.middlewares.ContentTypeMiddleware
2019
import software.amazon.smithy.swift.codegen.integration.middlewares.OperationInputBodyMiddleware
21-
import software.amazon.smithy.swift.codegen.model.hasTrait
2220
import software.amazon.smithy.swift.codegen.model.targetOrSelf
2321

2422
@Suppress("ktlint:standard:class-naming")
@@ -65,9 +63,6 @@ class AWSJSON1_0ProtocolGenerator : AWSHTTPBindingProtocolGenerator(AWSJSONCusto
6563
): List<MemberShape> =
6664
shape
6765
.members()
68-
// The only place an input member can be bound to in AWS JSON other than the body
69-
// is the host prefix, using the host label trait.
70-
.filter { !it.hasTrait<HostLabelTrait>() }
7166
// For RPC protocols that support event streaming, we need to send initial request
7267
// with streaming member excluded during encoding the input struct.
7368
.filter { !it.targetOrSelf(ctx.model).isEventStreaming }

codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/protocols/awsjson/AWSJSON1_1ProtocolGenerator.kt

-5
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ import software.amazon.smithy.model.shapes.MemberShape
1212
import software.amazon.smithy.model.shapes.OperationShape
1313
import software.amazon.smithy.model.shapes.Shape
1414
import software.amazon.smithy.model.shapes.ShapeId
15-
import software.amazon.smithy.model.traits.HostLabelTrait
1615
import software.amazon.smithy.swift.codegen.integration.HttpBindingResolver
1716
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
1817
import software.amazon.smithy.swift.codegen.integration.isEventStreaming
1918
import software.amazon.smithy.swift.codegen.integration.middlewares.ContentTypeMiddleware
2019
import software.amazon.smithy.swift.codegen.integration.middlewares.OperationInputBodyMiddleware
21-
import software.amazon.smithy.swift.codegen.model.hasTrait
2220
import software.amazon.smithy.swift.codegen.model.targetOrSelf
2321

2422
@Suppress("ktlint:standard:class-naming")
@@ -63,9 +61,6 @@ class AWSJSON1_1ProtocolGenerator : AWSHTTPBindingProtocolGenerator(AWSJSONCusto
6361
): List<MemberShape> =
6462
shape
6563
.members()
66-
// The only place an input member can be bound to in AWS JSON other than the body
67-
// is the host prefix, using the host label trait.
68-
.filter { !it.hasTrait<HostLabelTrait>() }
6964
// For RPC protocols that support event streaming, we need to send initial request
7065
// with streaming member excluded during encoding the input struct.
7166
.filter { !it.targetOrSelf(ctx.model).isEventStreaming }

codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/protocols/awsquery/AWSQueryProtocolGenerator.kt

+1-9
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ import software.amazon.smithy.model.shapes.MemberShape
1212
import software.amazon.smithy.model.shapes.OperationShape
1313
import software.amazon.smithy.model.shapes.Shape
1414
import software.amazon.smithy.model.shapes.ShapeId
15-
import software.amazon.smithy.model.traits.HostLabelTrait
1615
import software.amazon.smithy.swift.codegen.integration.HttpBindingResolver
1716
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
1817
import software.amazon.smithy.swift.codegen.integration.middlewares.ContentTypeMiddleware
1918
import software.amazon.smithy.swift.codegen.integration.middlewares.OperationInputBodyMiddleware
20-
import software.amazon.smithy.swift.codegen.model.hasTrait
2119

2220
open class AWSQueryProtocolGenerator : AWSHTTPBindingProtocolGenerator(AWSQueryCustomizations()) {
2321
override val defaultContentType = "application/x-www-form-urlencoded"
@@ -56,11 +54,5 @@ open class AWSQueryProtocolGenerator : AWSHTTPBindingProtocolGenerator(AWSQueryC
5654
override fun httpBodyMembers(
5755
ctx: ProtocolGenerator.GenerationContext,
5856
shape: Shape,
59-
): List<MemberShape> =
60-
shape
61-
.members()
62-
// The only place an input member can be bound to in AWSQuery other than the body
63-
// is the host prefix, using the host label trait.
64-
.filter { !it.hasTrait<HostLabelTrait>() }
65-
.toList()
57+
): List<MemberShape> = shape.members().toList()
6658
}

codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/protocols/ec2query/EC2QueryProtocolGenerator.kt

+1-9
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ import software.amazon.smithy.model.shapes.MemberShape
1212
import software.amazon.smithy.model.shapes.OperationShape
1313
import software.amazon.smithy.model.shapes.Shape
1414
import software.amazon.smithy.model.shapes.ShapeId
15-
import software.amazon.smithy.model.traits.HostLabelTrait
1615
import software.amazon.smithy.swift.codegen.integration.HttpBindingResolver
1716
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
1817
import software.amazon.smithy.swift.codegen.integration.middlewares.ContentTypeMiddleware
1918
import software.amazon.smithy.swift.codegen.integration.middlewares.OperationInputBodyMiddleware
20-
import software.amazon.smithy.swift.codegen.model.hasTrait
2119

2220
class EC2QueryProtocolGenerator : AWSHTTPBindingProtocolGenerator(EC2QueryCustomizations()) {
2321
override val defaultContentType = "application/x-www-form-urlencoded"
@@ -56,11 +54,5 @@ class EC2QueryProtocolGenerator : AWSHTTPBindingProtocolGenerator(EC2QueryCustom
5654
override fun httpBodyMembers(
5755
ctx: ProtocolGenerator.GenerationContext,
5856
shape: Shape,
59-
): List<MemberShape> =
60-
shape
61-
.members()
62-
// The only place an input member can be bound to in EC2Query other than the body
63-
// is the host prefix, using the host label trait.
64-
.filter { !it.hasTrait<HostLabelTrait>() }
65-
.toList()
57+
): List<MemberShape> = shape.members().toList()
6658
}

0 commit comments

Comments
 (0)