File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed
rivetkit-typescript/packages/rivetkit/src/manager Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,17 @@ function buildOpenApiResponses<T>(schema: T) {
7979 } ;
8080}
8181
82+ function buildOpenApiRequestBody < T > ( schema : T ) {
83+ return {
84+ required : true ,
85+ content : {
86+ "application/json" : {
87+ schema,
88+ } ,
89+ } ,
90+ } ;
91+ }
92+
8293export function createManagerRouter (
8394 registryConfig : RegistryConfig ,
8495 runConfig : RunnerConfig ,
@@ -405,13 +416,7 @@ function addManagerRoutes(
405416 method : "put" ,
406417 path : "/actors" ,
407418 request : {
408- body : {
409- content : {
410- "application/json" : {
411- schema : ActorsGetOrCreateRequestSchema ,
412- } ,
413- } ,
414- } ,
419+ body : buildOpenApiRequestBody ( ActorsGetOrCreateRequestSchema ) ,
415420 } ,
416421 responses : buildOpenApiResponses ( ActorsGetOrCreateResponseSchema ) ,
417422 } ) ;
@@ -457,13 +462,7 @@ function addManagerRoutes(
457462 method : "post" ,
458463 path : "/actors" ,
459464 request : {
460- body : {
461- content : {
462- "application/json" : {
463- schema : ActorsCreateRequestSchema ,
464- } ,
465- } ,
466- } ,
465+ body : buildOpenApiRequestBody ( ActorsCreateRequestSchema ) ,
467466 } ,
468467 responses : buildOpenApiResponses ( ActorsCreateResponseSchema ) ,
469468 } ) ;
You can’t perform that action at this time.
0 commit comments