Skip to content

Commit eee6cb5

Browse files
committed
Protocol selection priority update
1 parent 93503a5 commit eee6cb5

File tree

1 file changed

+7
-2
lines changed
  • tools/code-generation/generator/src/main/java/com/amazonaws/util/awsclientgenerator/domainmodels/codegeneration

1 file changed

+7
-2
lines changed

tools/code-generation/generator/src/main/java/com/amazonaws/util/awsclientgenerator/domainmodels/codegeneration/Metadata.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
@Data
1818
public class Metadata {
1919
private static List<String> supportedProtocols = ImmutableList.of(
20+
"smithy-rpc-v2-cbor",
2021
"json",
2122
"rest-json",
2223
"rest-xml",
2324
"query",
24-
"ec2",
25-
"smithy-rpc-v2-cbor"
25+
"ec2"
2626
);
2727

2828
private String apiVersion;
@@ -72,6 +72,11 @@ public String findFirstSupportedProtocol() {
7272
return protocol;
7373
}
7474

75+
//We're releasing CBOR so current services (only arc-region-switch) need to opt into the new protocol priority
76+
if (serviceFullName != null && serviceFullName.equalsIgnoreCase("ARC - Region switch")){
77+
return "json";
78+
}
79+
7580
return protocols.stream().filter(supportedProtocols::contains)
7681
.min(Comparator.comparingInt(protocolName -> supportedProtocols.indexOf(protocolName)))
7782
.orElseThrow(() -> new RuntimeException(String.format("No supported protocol found for %s", serviceFullName)));

0 commit comments

Comments
 (0)