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

Unable to reference types inside generated API client using module's namespace #template #153

Open
Kastet opened this issue Apr 18, 2019 · 1 comment

Comments

@Kastet
Copy link
Contributor

Kastet commented Apr 18, 2019

If using Cocoapods (not sure if true for other DMs), public struct {{ options.name }} will be matching your generated API client Swift module name which breaks types lookup. For example, if your codebase or another module has a type User and your generated API client has User, then referencing User from generated API client via {{ options.name }}.User won't work.

Apparently, it's a limitation of Swift compiler - https://bugs.swift.org/browse/SR-1386

Suggest moving away from public struct {{ options.name }} by splitting it up into public struct Config that holds coding options and Server and public struct Operation to namespace operations.

What do you think @yonaskolb ?

@Kastet
Copy link
Contributor Author

Kastet commented Apr 24, 2019

@yonaskolb have you had a chance to review this suggestion? Do you see a way to work around this problem without making braking changes?

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

No branches or pull requests

1 participant