@@ -14,20 +14,20 @@ import { entries } from "./utils";
1414export function trpcToOpenApi ( {
1515 apiTitle,
1616 apiVersion,
17- basePath = "" ,
17+ basePath,
1818 router,
1919} : {
2020 apiTitle : string ;
2121 apiVersion : string ;
22- basePath ? : string ;
22+ basePath : string ;
2323 router : AnyTRPCRouter ;
2424} ) : OpenAPIV3_1 . Document {
2525 return {
2626 openapi : "3.1.0" ,
2727 info : { title : apiTitle , version : apiVersion } ,
2828 paths : getPathsForRouterRecord (
2929 basePath ,
30- router . _def . procedures as RouterRecord ,
30+ router . _def . procedures as RouterRecord
3131 ) ,
3232 } ;
3333}
@@ -43,12 +43,12 @@ const PROCEDURE_TYPE_HTTP_METHOD_MAP: Record<
4343
4444function getPathsForRouterRecord (
4545 basePath : string ,
46- routerRecord : RouterRecord ,
46+ routerRecord : RouterRecord
4747) : OpenAPIV3_1 . PathsObject {
4848 const paths : OpenAPIV3_1 . PathsObject = { } ;
4949
5050 for ( const [ procedureName , procedureOrRouterRecord ] of entries (
51- routerRecord ,
51+ routerRecord
5252 ) ) {
5353 Object . assign (
5454 paths ,
@@ -58,7 +58,7 @@ function getPathsForRouterRecord(
5858 procedureName : String ( procedureName ) ,
5959 procedure : procedureOrRouterRecord ,
6060 } )
61- : getPathsForRouterRecord ( basePath , procedureOrRouterRecord ) ,
61+ : getPathsForRouterRecord ( basePath , procedureOrRouterRecord )
6262 ) ;
6363 }
6464
@@ -95,7 +95,7 @@ function getPathsForProcedure({
9595 const content = {
9696 "application/json" : {
9797 schema : zodToJsonSchema (
98- def . inputs [ 0 ] as ZodSchema ,
98+ def . inputs [ 0 ] as ZodSchema
9999 ) as OpenAPIV3 . SchemaObject ,
100100 } ,
101101 } ;
@@ -118,7 +118,7 @@ function getPathsForProcedure({
118118}
119119
120120function isProcedure (
121- maybeProcedure : AnyProcedure | RouterRecord ,
121+ maybeProcedure : AnyProcedure | RouterRecord
122122) : maybeProcedure is AnyProcedure {
123123 return ( maybeProcedure as AnyProcedure ) . _def . procedure === true ;
124124}
0 commit comments