[BUG][typescript-angular] Multiple tags and `useSingleRequestParameter` cause duplicate export
Created by: snebjorn
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? - Issue is still present in master https://github.com/snebjorn/openapi-gen-bug/tree/master/output-master/export-bug
-
Have you searched for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Defining operations with multiple tags leads to duplicate export.
Module './tag1.service' has already exported a member named 'FoosParam1BarsGetRequestParams'. Consider explicitly re-exporting to resolve the ambiguity. ts(2308)
FoosParam1BarsGetRequestParams
is declared in both these places:
- https://github.com/snebjorn/openapi-gen-bug/blob/ad3851d72b3a9bfe8bc49604730d013e03813b73/output-6.0.1/export-bug/api/tag1.service.ts#L27
- https://github.com/snebjorn/openapi-gen-bug/blob/ad3851d72b3a9bfe8bc49604730d013e03813b73/output-6.0.1/export-bug/api/tag2.service.ts#L27
openapi-generator version
6.0.1
OpenAPI declaration file content or url
https://raw.githubusercontent.com/snebjorn/openapi-gen-bug/master/export-bug.json
{
"openapi": "3.0.0",
"info": {
"title": "",
"version": ""
},
"paths": {
"/Foos/{Param1}/Bars": {
"parameters": [
{
"name": "Param1",
"in": "path",
"required": true,
"description": "",
"schema": { "type": "string" }
}
],
"get": {
"tags": ["Tag1", "Tag2"],
"responses": {
"200": {
"description": ""
}
}
}
}
}
}
Generation Details
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
-i https://raw.githubusercontent.com/snebjorn/openapi-gen-bug/master/export-bug.json \
-g typescript-angular \
-o output-master/export-bug \
-p=useSingleRequestParameter=true
Steps to reproduce
- Clone https://github.com/snebjorn/openapi-gen-bug
- Run
yarn install
- Run
yarn gen
- Observe export error in https://github.com/snebjorn/openapi-gen-bug/blob/master/output-6.0.1/export-bug/api/api.ts
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/issues/7519
Suggest a fix
Prefix with their tag as to avoid duplicate exports.