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

incorrect code generation for option --group-strategy=tag #176

Open
wilfried-huss opened this issue Jul 4, 2023 · 1 comment
Open

incorrect code generation for option --group-strategy=tag #176

wilfried-huss opened this issue Jul 4, 2023 · 1 comment

Comments

@wilfried-huss
Copy link

When the option --group-strategy=tag is defined, the generated client contains the following
incorrect function definition:

export function createApiClient(baseUrl: string, options?: ZodiosOptions) {
    return new Zodios(baseUrl, endpoints, options);
}

This causes compilation errors:

src/api/client/system.ts:161:60 - error TS2304: Cannot find name 'ZodiosOptions'.

161 export function createApiClient(baseUrl: string, options?: ZodiosOptions) {
                                                               ~~~~~~~~~~~~~

src/api/client/system.ts:162:32 - error TS2304: Cannot find name 'endpoints'.

162     return new Zodios(baseUrl, endpoints, options);
                                   ~~~~~~~~~

The createApiClient function is not needed. If it is removed the generated code works as expected.

@astahmer
Copy link
Owner

astahmer commented Jul 4, 2023

this looks like it still exists in zodios side
https://github.com/ecyrbe/zodios/blob/bc05f0fbfe51dd7db3fd89b27e3a92ed0c1c8559/website/docs/client/client.md?plain=1#L22

you can use a custom template to remove this import / the createApiClient

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

2 participants