-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG][swift6] Generator does not honor ProjectName for APIs client #20056
Comments
Hi, this decision was made because other generators, for example kotlin client has a similar approach by having an |
I had a project using 2 outputs from the Open API Generator, since I needed to connect to two servers in the same app, and I did run into the issue that the OpenAPIClient name was used twice in different dependencies. By default there's a module called |
Since this is creating issues to more than one person, I think we should revert it now, while the generator is still in beta. |
The issue @x-sheep brings up is interesting because of the default naming. I am not against the default and easy locating of having a file named OpenAPIClient, but the collision between Module and Type is a bigger problem. What about renaming it to have a default module name of OpenAPIClient and a type APIClient? Namespacing APIClient is not that big of an inconvenience, but i have no strong feelings besides having differently named modules and type. |
I was thinking of naming it |
I'm in favor of that, I didn't like the {{projectName}}API. |
There is a potencial issue with {{projectName}}APIClient, for example with the PetstoreClient, it will be PetstoreClientAPIClient. |
It comes to mind those 3 options: |
So I'm not opposed to having a static name for it. I think if we did APIClient for this class, but kept OpenAPIClient as the default folder name, it would solve the problem x-sheep was seeing with the Type and Module name conflicting, and would keep it consistent with the other generators it sounds like. |
I have opened #20103 I ended up using {{projectName}}APIConfiguration. What do you all think of this? |
Bug Report Checklist
Description
swift5 used to apply the ProjectName to the API. I see that swift6 did the same until #19732 where
{{projectName}}API
was changed to OpenAPIClient.openapi-generator version
v7.9.0
Generation Details
Can just use the default PetStore generation details to see the bug
Steps to reproduce
Supply
projectName
to the swift6 generator and observe that projectName does not get appended to the OpenAPIClient objectRelated issues/PRs
#19732
Suggest a fix
Not sure if this necessarily a bug, however, we used the ProjectName to differentiate between our various OpenAPI clients and reduce collisions (without the need to name space).
The text was updated successfully, but these errors were encountered: