Skip to content
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][swift5] module and class with same name #9953

Closed
Feuerwerk opened this issue Jul 15, 2021 · 4 comments · Fixed by #10387
Closed

[BUG][swift5] module and class with same name #9953

Feuerwerk opened this issue Jul 15, 2021 · 4 comments · Fixed by #10387

Comments

@Feuerwerk
Copy link
Contributor

Feuerwerk commented Jul 15, 2021

Description

Since your change to deprecate the #projectName#API class and replace it with the #projectName# class in the APIs file and naming the module also #projectName# it is now impossible to access an api model type by adding the module name since the swift compiler now complains the the class #projectName# doesn't contain the type XXX

This is due to a bug in the swift compiler (see https://bugs.swift.org/browse/SR-898) which is still not resolved.

openapi-generator version

5.2.0

@honkmaster
Copy link
Contributor

Running into the same issue here. This is a rather critical error for us, any idea when this will be fixed?

@4brunu
Copy link
Contributor

4brunu commented Sep 1, 2021

Can you please provide a sample project with the error? Thanks

@Feuerwerk
Copy link
Contributor Author

OpenApi_Issue9953.zip
Hi, created a small test project. You will find the compiler error in OpenApi_Issue9953/main.swift.
The error occurs because the data type Pet exists in both projects OpenApi_Issue9953 and ApiClient and therefore it is necessary to fully qualify the data types when using. But the module name ApiClient can't be used because it is a data type at the same time.

@4brunu
Copy link
Contributor

4brunu commented Sep 13, 2021

Hey, I created #10387 that should fix this issue.
Can you please check to see if you you agree with the solutions or have other suggestions?
Thankss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants