Open mkeyy0 opened 1 month ago
Hey @mkeyy0, yeah that's always a risk. How would you resolve this conflict?
@mrlubos I'm not sure, to be honest. It can be done in several ways:
createClient
function name from the settings. But I'm not sure it's a good way to do this;
I guess that preferred way is:import { createClient } from '@hey-api/client-fetch';
In the generated file use the following syntax
import { createClient as _createClient } from '@hey-api/client-fetch';
Anyway, createClient
is not exported from the generated file, it's an internal implementation. So, to avoid name collisions, we add the _
internal property mark. It can be the same for the createConfig
function.
What are your thoughts on this?
Yeah I think I'll need to move the client entirely out of the file since you'd be running into the same problem if your service was called "client", except I wouldn't be able to alias it then. Thanks for reporting, will improve this
Description
I have a createClient operation in my openAPI schema, generating the
createClient
function. But at the same timecreateClient
function is imported from the@hey-api/client-fetch
package. It results in the name collision in theservices.gen
file. It would be nice to have an option to avoid collision.Reproducible example or configuration
No response
OpenAPI specification (optional)
No response
System information (optional)
No response