You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement a custom versioning pattern (some modules use path and some header) with multiple documents served per version. My plan is to include all of the metadata that I need in the operationId and then do the filtering per document in patchDocumentOnRequest function.
I found a bug in the "operationIdFactory", where it only receives version parameter from path versioning.
app.enableVersioning({type: VersioningType.CUSTOM,defaultVersion: '1',extractor(request){return'1.0';// irrelevant for the example}});constdocumentOptions=newDocumentBuilder().setTitle(`repro | OpenAPI`).setVersion('1.0').build();SwaggerModule.createDocument(app,documentOptions,{operationIdFactory: (controllerKey,methodKey,version)=>{constopId=`${controllerKey}_${methodKey}_${version}`;console.log(opId);// AppController_getHelloV2_undefinedreturnopId;}});
It seems that it is hardcoded that the only version that is being passed to the 'getOperationId' function is the pathVersion, ignoring method and controller versions:
Is there an existing issue for this?
Current behavior
I'm trying to implement a custom versioning pattern (some modules use path and some header) with multiple documents served per version. My plan is to include all of the metadata that I need in the operationId and then do the filtering per document in
patchDocumentOnRequest
function.I found a bug in the "operationIdFactory", where it only receives version parameter from path versioning.
Take a look at this example:
It seems that it is hardcoded that the only version that is being passed to the 'getOperationId' function is the pathVersion, ignoring method and controller versions:
swagger/lib/swagger-explorer.ts
Line 387 in e949cef
Minimum reproduction code
https://github.com/triforcely/nest-js-operationifactorybug
Steps to reproduce
No response
Expected behavior
When any api versioning is present, the parameter shouldn't be undefined.
Package version
11.0.3
NestJS version
11.0.5
Node.js version
22.13.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: