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
Describe the bug
When having endpoints of the same name, eg tags/{tag}/export and labels/{label}/export, only one data type is generated (here ExportData) for all services, which is correct for the first, but wrong for all subsequent services.
Expected behavior
Data types free of conflicts, eg ExportData, ExportData1, etc
Hi @CHE1RON, I might add support for invalid OpenAPI specs in future versions, but for now I'd recommend fixing your spec by making sure each operationId is unique. You might also try resolving the name yourself using services.methodNameBuilder(). I assume there's a reason you use the same identifier multiple times?
@CHE1RON ha! I feel pretty strongly about investing in your OpenAPI spec and I plan to add some content about this in the future. You can't expect the tooling to create perfect clients if your spec is shoddy. Of course that's not always an option, but if it is, I'd recommend doing that.
In this case, the issue itself could be handled. I plan to add strict and loose modes that would either throw on any invalid definition or try to compile at the expense of output quality. But again, try to solve the problem at the source if possible (your OpenAPI spec), which it sounds like you chose to do. I support that! 😀
Description
Describe the bug
When having endpoints of the same name, eg
tags/{tag}/export
andlabels/{label}/export
, only one data type is generated (hereExportData
) for all services, which is correct for the first, but wrong for all subsequent services.Expected behavior
Data types free of conflicts, eg
ExportData
,ExportData1
, etcSee my downstream issue here.
Reproducible example or configuration
To Reproduce
tags/{tag}/export
andlabels/{label}/export
services.gen.ts
OpenAPI specification (optional)
OpenAPI spec file
routes.json
System information (optional)
The text was updated successfully, but these errors were encountered: