File tree 2 files changed +11
-12
lines changed
2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -256,15 +256,16 @@ export const buildPathIdParameters = (
256
256
* Build a parameter object with additional parameters that are not inferred from the path.
257
257
*/
258
258
export const customParameters = ( ) : Record < string , OpenAPIV3 . ParameterObject > => {
259
+ const entityId = 'tenantId' ;
260
+ const shared = Object . freeze ( {
261
+ in : 'path' ,
262
+ description : 'The unique identifier of the tenant.' ,
263
+ required : true ,
264
+ schema : { type : 'string' } ,
265
+ } as const ) ;
266
+
259
267
return Object . freeze ( {
260
- tenantId : {
261
- name : 'tenantId' ,
262
- in : 'path' ,
263
- description : 'The unique identifier of the tenant.' ,
264
- required : true ,
265
- schema : {
266
- type : 'string' ,
267
- } ,
268
- } ,
268
+ [ `${ entityId } -root` ] : { name : 'id' , ...shared } ,
269
+ [ entityId ] : { name : 'tenantId' , ...shared } ,
269
270
} ) ;
270
271
} ;
Original file line number Diff line number Diff line change @@ -207,9 +207,7 @@ export const zodTypeToSwagger = (
207
207
if ( config instanceof ZodObject ) {
208
208
// Type from Zod is any
209
209
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
210
- const entries = Object . entries ( config . shape )
211
- // `tenantId` is not editable for all routes
212
- . filter ( ( [ key ] ) => key !== 'tenantId' ) ;
210
+ const entries = Object . entries ( config . shape ) ;
213
211
const required = entries
214
212
. filter ( ( [ , value ] ) => ! ( value instanceof ZodOptional ) )
215
213
. map ( ( [ key ] ) => key ) ;
You can’t perform that action at this time.
0 commit comments