@@ -52,6 +52,7 @@ static void generateServiceHandler(SymbolProvider symbolProvider,
52
52
Symbol serviceSymbol = symbolProvider .toSymbol (serviceShape );
53
53
Symbol handlerSymbol = serviceSymbol .expectProperty ("handler" , Symbol .class );
54
54
Symbol operationsType = serviceSymbol .expectProperty ("operations" , Symbol .class );
55
+ writer .addImport ("ServerSerdeContext" , null , "@aws-smithy/server-common" );
55
56
56
57
writeSerdeContextBase (writer );
57
58
writeHandleFunction (writer );
@@ -62,7 +63,7 @@ static void generateServiceHandler(SymbolProvider symbolProvider,
62
63
writer .write ("private serializerFactory: <T extends $T>(operation: T) => "
63
64
+ "__OperationSerializer<$T, T, __SmithyException>;" , operationsType , serviceSymbol );
64
65
writer .write ("private serializeFrameworkException: (e: __SmithyFrameworkException, "
65
- + "ctx: Omit<SerdeContext, 'endpoint'> ) => Promise<__HttpResponse>;" );
66
+ + "ctx: ServerSerdeContext ) => Promise<__HttpResponse>;" );
66
67
writer .writeDocs (() -> {
67
68
writer .write ("Construct a $T handler." , serviceSymbol );
68
69
writer .write ("@param service The {@link $1T} implementation that supplies the business logic for $1T" ,
@@ -81,8 +82,8 @@ static void generateServiceHandler(SymbolProvider symbolProvider,
81
82
writer .write ("mux: __Mux<$S, $T>," , serviceShape .getId ().getName (), operationsType );
82
83
writer .write ("serializerFactory:<T extends $T>(op: T) => "
83
84
+ "__OperationSerializer<$T, T, __SmithyException>," , operationsType , serviceSymbol );
84
- writer .write ("serializeFrameworkException: (e: __SmithyFrameworkException, ctx: Omit<SerdeContext, "
85
- + "'endpoint'>) => Promise<__HttpResponse>" );
85
+ writer .write ("serializeFrameworkException: (e: __SmithyFrameworkException, ctx: ServerSerdeContext) => "
86
+ + "Promise<__HttpResponse>" );
86
87
});
87
88
writer .indent ();
88
89
writer .write ("this.service = service;" );
@@ -127,14 +128,15 @@ static void generateOperationHandler(SymbolProvider symbolProvider,
127
128
Symbol outputSymbol = operationSymbol .expectProperty ("outputType" , Symbol .class );
128
129
Symbol handlerSymbol = operationSymbol .expectProperty ("handler" , Symbol .class );
129
130
Symbol errorsSymbol = operationSymbol .expectProperty ("errorsType" , Symbol .class );
131
+ writer .addImport ("ServerSerdeContext" , null , "@aws-smithy/server-common" );
130
132
131
133
writer .openBlock ("export class $L implements __ServiceHandler {" , "}" , handlerSymbol .getName (), () -> {
132
134
writer .write ("private operation: __Operation<$T, $T>;" , inputSymbol , outputSymbol );
133
135
writer .write ("private mux: __Mux<$S, $S>;" , serviceShape .getId ().getName (), operationName );
134
136
writer .write ("private serializer: __OperationSerializer<$T, $S, $T>;" ,
135
137
serviceSymbol , operationName , errorsSymbol );
136
138
writer .write ("private serializeFrameworkException: (e: __SmithyFrameworkException, "
137
- + "ctx: Omit<SerdeContext, 'endpoint'> ) => Promise<__HttpResponse>;" );
139
+ + "ctx: ServerSerdeContext ) => Promise<__HttpResponse>;" );
138
140
writer .writeDocs (() -> {
139
141
writer .write ("Construct a $T handler." , operationSymbol );
140
142
writer .write ("@param service The {@link __Operation} implementation that supplies the business "
@@ -152,8 +154,8 @@ static void generateOperationHandler(SymbolProvider symbolProvider,
152
154
writer .write ("mux: __Mux<$S, $S>," , serviceShape .getId ().getName (), operationName );
153
155
writer .write ("serializer: __OperationSerializer<$T, $S, $T>," ,
154
156
serviceSymbol , operationName , errorsSymbol );
155
- writer .write ("serializeFrameworkException: (e: __SmithyFrameworkException, ctx: Omit<SerdeContext, "
156
- + "'endpoint'>) => Promise<__HttpResponse>" );
157
+ writer .write ("serializeFrameworkException: (e: __SmithyFrameworkException, ctx: ServerSerdeContext) => "
158
+ + "Promise<__HttpResponse>" );
157
159
});
158
160
writer .indent ();
159
161
writer .write ("this.operation = operation;" );
@@ -198,7 +200,7 @@ private static void writeHandleFunction(TypeScriptWriter writer) {
198
200
writer .write ("serializer: __OperationSerializer<S, O, __SmithyException>," );
199
201
writer .write ("operation: __Operation<__OperationInput<S[O]>, __OperationOutput<S[O]>>," );
200
202
writer .write ("serializeFrameworkException: (e: __SmithyFrameworkException, "
201
- + "ctx: Omit<SerdeContext, 'endpoint'> ) => Promise<__HttpResponse>" );
203
+ + "ctx: ServerSerdeContext ) => Promise<__HttpResponse>" );
202
204
});
203
205
writer .indent ();
204
206
writer .write ("let input;" );
0 commit comments