@@ -953,8 +953,8 @@ private void writeRequestHeaders(
953
953
) {
954
954
TypeScriptWriter writer = context .getWriter ();
955
955
956
- List <HttpBinding > headers = bindingIndex .getRequestBindings (operation , Location .HEADER );
957
956
List <HttpBinding > prefixHeaders = bindingIndex .getRequestBindings (operation , Location .PREFIX_HEADERS );
957
+ List <HttpBinding > headers = bindingIndex .getRequestBindings (operation , Location .HEADER );
958
958
boolean inputPresent = operation .getInput ().isPresent ();
959
959
960
960
int normalHeaderCount = headers .size ();
@@ -981,19 +981,19 @@ private void writeRequestHeaders(
981
981
writeDefaultInputHeaders (context , operation );
982
982
983
983
if (inputPresent ) {
984
- for (HttpBinding binding : headers ) {
985
- writeNormalHeader (context , binding );
984
+ // Handle assembling prefix headers.
985
+ for (HttpBinding binding : prefixHeaders ) {
986
+ writePrefixHeaders (context , binding );
986
987
}
987
988
}
988
989
989
- flushHeadersBuffer (writer );
990
-
991
990
if (inputPresent ) {
992
- // Handle assembling prefix headers.
993
- for (HttpBinding binding : prefixHeaders ) {
994
- writePrefixHeaders (context , binding );
991
+ for (HttpBinding binding : headers ) {
992
+ writeNormalHeader (context , binding );
995
993
}
996
994
}
995
+
996
+ flushHeadersBuffer (writer );
997
997
writer .dedent ();
998
998
writer .write (closing );
999
999
}
@@ -1081,13 +1081,13 @@ private void writePrefixHeaders(GenerationContext context, HttpBinding binding)
1081
1081
String headerValue = getInputValue (context , binding .getLocation (),
1082
1082
memberLocation + "![suffix]" , binding .getMember (), target );
1083
1083
// Append the prefix to key.
1084
- writer .write ("acc[`$L$${suffix.toLowerCase()}`] = $L ;" ,
1084
+ writer .write ("acc = { ...{ [`$L$${suffix.toLowerCase()}`]: $L}, ...acc } ;" ,
1085
1085
binding .getLocationName ().toLowerCase (Locale .US ), headerValue );
1086
1086
writer .write ("return acc;" );
1087
1087
});
1088
- }
1089
- );
1090
- }
1088
+ }
1089
+ );
1090
+ }
1091
1091
1092
1092
private void writeResponseHeaders (
1093
1093
GenerationContext context ,
@@ -1103,16 +1103,16 @@ private void writeResponseHeaders(
1103
1103
writeContentTypeHeader (context , operationOrError , false );
1104
1104
injectExtraHeaders .run ();
1105
1105
1106
+ for (HttpBinding binding : bindingIndex .getResponseBindings (operationOrError , Location .PREFIX_HEADERS )) {
1107
+ writePrefixHeaders (context , binding );
1108
+ }
1109
+
1110
+ // Handle assembling prefix headers.
1106
1111
for (HttpBinding binding : bindingIndex .getResponseBindings (operationOrError , Location .HEADER )) {
1107
1112
writeNormalHeader (context , binding );
1108
1113
}
1109
1114
1110
1115
flushHeadersBuffer (writer );
1111
-
1112
- // Handle assembling prefix headers.
1113
- for (HttpBinding binding : bindingIndex .getResponseBindings (operationOrError , Location .PREFIX_HEADERS )) {
1114
- writePrefixHeaders (context , binding );
1115
- }
1116
1116
});
1117
1117
}
1118
1118
@@ -2251,12 +2251,12 @@ private void readResponseHeaders(
2251
2251
HttpBindingIndex bindingIndex ,
2252
2252
String outputName
2253
2253
) {
2254
- List <HttpBinding > headerBindings = bindingIndex .getResponseBindings (operationOrError , Location .HEADER );
2255
- readNormalHeaders (context , headerBindings , outputName );
2256
-
2257
2254
List <HttpBinding > prefixHeaderBindings =
2258
2255
bindingIndex .getResponseBindings (operationOrError , Location .PREFIX_HEADERS );
2259
2256
readPrefixHeaders (context , prefixHeaderBindings , outputName );
2257
+
2258
+ List <HttpBinding > headerBindings = bindingIndex .getResponseBindings (operationOrError , Location .HEADER );
2259
+ readNormalHeaders (context , headerBindings , outputName );
2260
2260
}
2261
2261
2262
2262
private void readRequestHeaders (
@@ -2265,12 +2265,12 @@ private void readRequestHeaders(
2265
2265
HttpBindingIndex bindingIndex ,
2266
2266
String outputName
2267
2267
) {
2268
- List <HttpBinding > headerBindings = bindingIndex .getRequestBindings (operation , Location .HEADER );
2269
- readNormalHeaders (context , headerBindings , outputName );
2270
-
2271
2268
List <HttpBinding > prefixHeaderBindings =
2272
2269
bindingIndex .getRequestBindings (operation , Location .PREFIX_HEADERS );
2273
2270
readPrefixHeaders (context , prefixHeaderBindings , outputName );
2271
+
2272
+ List <HttpBinding > headerBindings = bindingIndex .getRequestBindings (operation , Location .HEADER );
2273
+ readNormalHeaders (context , headerBindings , outputName );
2274
2274
}
2275
2275
2276
2276
/**
@@ -2992,3 +2992,24 @@ protected boolean enableSerdeElision() {
2992
2992
return false ;
2993
2993
}
2994
2994
}
2995
+ ads .
2996
+ */
2997
+ protected abstract boolean requiresNumericEpochSecondsInPayload ();
2998
+
2999
+ /**
3000
+ * Implement a return true if the protocol allows elision of serde functions.
3001
+ *
3002
+ * @return whether protocol implementation is compatible with serde elision.
3003
+ */
3004
+ protected boolean enableSerdeElision () {
3005
+ return false ;
3006
+ }
3007
+ }
3008
+ e if the protocol allows elision of serde functions .
3009
+ *
3010
+ * @ return whether protocol implementation is compatible with serde elision .
3011
+ */
3012
+ protected boolean enableSerdeElision () {
3013
+ return false ;
3014
+ }
3015
+ }
0 commit comments