Skip to content

Client instance duplicate identifier #517

Open
@bkdiehl

Description

@bkdiehl

Description

When generating a client instance, I'm running into a duplicate identifier

export class AuthClient {
  public readonly model: ModelService;
  public readonly request: RequestService;

  public readonly request: BaseHttpRequest;

  constructor(
    config?: Partial<OpenAPIConfig>,
    HttpRequest: HttpRequestConstructor = FetchHttpRequest
  ) {
    this.request = new HttpRequest({
      BASE: config?.BASE ?? '',
      VERSION: config?.VERSION ?? '2',
      WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
      CREDENTIALS: config?.CREDENTIALS ?? 'include',
      TOKEN: config?.TOKEN,
      USERNAME: config?.USERNAME,
      PASSWORD: config?.PASSWORD,
      HEADERS: config?.HEADERS,
      ENCODE_PATH: config?.ENCODE_PATH,
      interceptors: {
        request: config?.interceptors?.request ?? new Interceptors(),
        response: config?.interceptors?.response ?? new Interceptors(),
      },
    });

    this.model = new ModelService(this.request);
    this.request = new RequestService(this.request);
  }
}

public readonly request: BaseHttpRequest; collides with the generated public readonly request: RequestService;
I'm not sure what naming conventions you have planned, but it would be great if naming conventions for either the generated services or the baseHttpRequest had no chance of collisions.

OpenAPI specification (optional)

No response

Configuration

export default defineConfig({
  name: 'AuthClient',
});

System information (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Something isn't workinghelp wanted 🙋This issue is unlikely to be prioritized, please contribute a pull request if you'd like it resolved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions