File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
codegen/src/main/java/software/amazon/awssdk/codegen Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 15
15
16
16
package software .amazon .awssdk .codegen .customization .processors ;
17
17
18
+ import java .util .Collections ;
18
19
import software .amazon .awssdk .codegen .customization .CodegenCustomizationProcessor ;
19
20
import software .amazon .awssdk .codegen .model .config .customization .MetadataConfig ;
20
21
import software .amazon .awssdk .codegen .model .intermediate .IntermediateModel ;
@@ -44,7 +45,7 @@ public void preprocess(ServiceModel serviceModel) {
44
45
45
46
String customProtocol = metadataConfig .getProtocol ();
46
47
if (customProtocol != null ) {
47
- serviceMetadata .setProtocol ( customProtocol );
48
+ serviceMetadata .setProtocols ( Collections . singletonList ( customProtocol ) );
48
49
}
49
50
50
51
}
Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ public String getProtocol() {
114
114
return protocol ;
115
115
}
116
116
117
+ /**
118
+ * {@code protocol} superseded by {@code protocols} field, resolved in {@link ProtocolUtils#resolveProtocol(ServiceMetadata)}
119
+ */
120
+ @ Deprecated
117
121
public void setProtocol (String protocol ) {
118
122
this .protocol = protocol ;
119
123
}
Original file line number Diff line number Diff line change @@ -43,11 +43,15 @@ public static String resolveProtocol(ServiceMetadata serviceMetadata) {
43
43
List <String > protocols = serviceMetadata .getProtocols ();
44
44
String protocol = serviceMetadata .getProtocol ();
45
45
46
- // Kinesis uses customization.config customServiceMetadata to set cbor
47
- if ("cbor" .equals (protocol ) || protocols == null || protocols .isEmpty ()) {
46
+ if (protocols == null || protocols .isEmpty ()) {
48
47
return protocol ;
49
48
}
50
49
50
+ // Kinesis uses customization.config customServiceMetadata to set cbor
51
+ if ("cbor" .equals (protocols .get (0 ))) {
52
+ return "cbor" ;
53
+ }
54
+
51
55
for (String supportedProtocol : SUPPORTED_PROTOCOLS ) {
52
56
if (protocols .contains (supportedProtocol )) {
53
57
return supportedProtocol ;
You can’t perform that action at this time.
0 commit comments