@@ -284,6 +284,18 @@ export type ServiceHandlerOpts = {
284
284
* Additional metadata for the handler.
285
285
*/
286
286
metadata ?: Record < string , string > ;
287
+
288
+ /**
289
+ * An optional JSON schema definition for the input parameter.
290
+ * Please note that this is not enforced, but only used as a documentation hint.
291
+ */
292
+ inputSchema ?: object ;
293
+
294
+ /**
295
+ * An optional JSON schema definition for the input parameter.
296
+ * Please note that this is not enforced, but only used as a documentation hint.
297
+ */
298
+ outputSchema ?: object ;
287
299
} ;
288
300
289
301
export type ObjectHandlerOpts = {
@@ -325,6 +337,18 @@ export type ObjectHandlerOpts = {
325
337
* Additional metadata for the handler.
326
338
*/
327
339
metadata ?: Record < string , string > ;
340
+
341
+ /**
342
+ * An optional JSON schema definition for the input parameter.
343
+ * Please note that this is not enforced, but only used as a documentation hint.
344
+ */
345
+ inputSchema ?: object ;
346
+
347
+ /**
348
+ * An optional JSON schema definition for the input parameter.
349
+ * Please note that this is not enforced, but only used as a documentation hint.
350
+ */
351
+ outputSchema ?: object ;
328
352
} ;
329
353
330
354
export type WorkflowHandlerOpts = {
@@ -366,6 +390,18 @@ export type WorkflowHandlerOpts = {
366
390
* Additional metadata for the handler.
367
391
*/
368
392
metadata ?: Record < string , string > ;
393
+
394
+ /**
395
+ * An optional JSON schema definition for the input parameter.
396
+ * Please note that this is not enforced, but only used as a documentation hint.
397
+ */
398
+ inputSchema ?: object ;
399
+
400
+ /**
401
+ * An optional JSON schema definition for the input parameter.
402
+ * Please note that this is not enforced, but only used as a documentation hint.
403
+ */
404
+ outputSchema ?: object ;
369
405
} ;
370
406
371
407
const HANDLER_SYMBOL = Symbol ( "Handler" ) ;
@@ -393,7 +429,9 @@ export class HandlerWrapper {
393
429
outputSerde ,
394
430
opts ?. accept ,
395
431
opts ?. description ,
396
- opts ?. metadata
432
+ opts ?. metadata ,
433
+ opts ?. inputSchema ,
434
+ opts ?. outputSchema
397
435
) ;
398
436
}
399
437
@@ -412,7 +450,9 @@ export class HandlerWrapper {
412
450
public readonly outputSerde : Serde < unknown > ,
413
451
accept ?: string ,
414
452
public readonly description ?: string ,
415
- public readonly metadata ?: Record < string , string >
453
+ public readonly metadata ?: Record < string , string > ,
454
+ public readonly inputSchema ?: object ,
455
+ public readonly outputSchema ?: object
416
456
) {
417
457
this . accept = accept ? accept : inputSerde . contentType ;
418
458
this . contentType = outputSerde . contentType ;
0 commit comments