File tree Expand file tree Collapse file tree
codegen/src/main/java/software/amazon/awssdk/codegen Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616package software .amazon .awssdk .codegen .customization .processors ;
1717
18+ import java .util .Collections ;
1819import software .amazon .awssdk .codegen .customization .CodegenCustomizationProcessor ;
1920import software .amazon .awssdk .codegen .model .config .customization .MetadataConfig ;
2021import software .amazon .awssdk .codegen .model .intermediate .IntermediateModel ;
@@ -44,7 +45,7 @@ public void preprocess(ServiceModel serviceModel) {
4445
4546 String customProtocol = metadataConfig .getProtocol ();
4647 if (customProtocol != null ) {
47- serviceMetadata .setProtocol ( customProtocol );
48+ serviceMetadata .setProtocols ( Collections . singletonList ( customProtocol ) );
4849 }
4950
5051 }
Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ public String getProtocol() {
114114 return protocol ;
115115 }
116116
117+ /**
118+ * {@code protocol} superseded by {@code protocols} field, resolved in {@link ProtocolUtils#resolveProtocol(ServiceMetadata)}
119+ */
120+ @ Deprecated
117121 public void setProtocol (String protocol ) {
118122 this .protocol = protocol ;
119123 }
Original file line number Diff line number Diff line change @@ -43,11 +43,15 @@ public static String resolveProtocol(ServiceMetadata serviceMetadata) {
4343 List <String > protocols = serviceMetadata .getProtocols ();
4444 String protocol = serviceMetadata .getProtocol ();
4545
46- // Kinesis uses customization.config customServiceMetadata to set cbor
47- if ("cbor" .equals (protocol ) || protocols == null || protocols .isEmpty ()) {
46+ if (protocols == null || protocols .isEmpty ()) {
4847 return protocol ;
4948 }
5049
50+ // Kinesis uses customization.config customServiceMetadata to set cbor
51+ if ("cbor" .equals (protocols .get (0 ))) {
52+ return "cbor" ;
53+ }
54+
5155 for (String supportedProtocol : SUPPORTED_PROTOCOLS ) {
5256 if (protocols .contains (supportedProtocol )) {
5357 return supportedProtocol ;
You can’t perform that action at this time.
0 commit comments