@@ -248,7 +248,7 @@ private void generateOperationResponseSerializer(
248
248
249
249
writer .openBlock ("export const $L = async(\n "
250
250
+ " input: $T,\n "
251
- + " context: $L \n "
251
+ + " context: Omit<$L, 'endpoint'> \n "
252
252
+ "): Promise<$T> => {" , "}" , methodName , outputType , contextType , responseType , () -> {
253
253
writeOperationStatusCode (context , operation , bindingIndex , trait );
254
254
writeResponseHeaders (context , operation , bindingIndex , () -> writeDefaultHeaders (context , operation ));
@@ -287,7 +287,7 @@ private void generateErrorSerializer(GenerationContext context, StructureShape e
287
287
288
288
writer .openBlock ("export const $L = async(\n "
289
289
+ " input: $T,\n "
290
- + " context: __SerdeContext\n "
290
+ + " context: Omit< __SerdeContext, 'endpoint'> \n "
291
291
+ "): Promise<$T> => {" , "}" , methodName , symbol , responseType , () -> {
292
292
writeErrorStatusCode (context , error );
293
293
writeResponseHeaders (context , error , bindingIndex , () -> writeDefaultErrorHeaders (context , error ));
@@ -1178,8 +1178,8 @@ private void readPath(
1178
1178
pathRegexBuilder .append ("/" );
1179
1179
}
1180
1180
writer .write ("const pathRegex = new RegExp($S);" , pathRegexBuilder .toString ());
1181
- writer .write ("const parsedPath: RegExpMatchArray = output.endpoint .path.match(pathRegex);" );
1182
- writer .openBlock ("if (parsedPath.groups !== undefined) {" , "}" , () -> {
1181
+ writer .write ("const parsedPath = output.path.match(pathRegex);" );
1182
+ writer .openBlock ("if (parsedPath? .groups !== undefined) {" , "}" , () -> {
1183
1183
for (HttpBinding binding : pathBindings ) {
1184
1184
Shape target = context .getModel ().expectShape (binding .getMember ().getTarget ());
1185
1185
String memberName = context .getSymbolProvider ().toMemberName (binding .getMember ());
@@ -1210,9 +1210,9 @@ private void readHost(GenerationContext context, OperationShape operation) {
1210
1210
}
1211
1211
}
1212
1212
writer .write ("const hostRegex = new RegExp($S);" , endpointRegexBuilder .toString ());
1213
- writer .write ("const parsedHost: RegExpMatchArray = output.endpoint .path.match(pathRegex);" );
1213
+ writer .write ("const parsedHost = output.path.match(pathRegex);" );
1214
1214
Shape input = context .getModel ().expectShape (operation .getInput ().get ());
1215
- writer .openBlock ("if (parsedHost.groups !== undefined) {" , "}" , () -> {
1215
+ writer .openBlock ("if (parsedHost? .groups !== undefined) {" , "}" , () -> {
1216
1216
for (MemberShape member : input .members ()) {
1217
1217
if (member .hasTrait (HostLabelTrait .class )) {
1218
1218
Shape target = context .getModel ().expectShape (member .getTarget ());
0 commit comments