Skip to content

[Bug]: Child client missing initialization parameter in some cases #3409

@jhendrixMSFT

Description

@jhendrixMSFT

Describe the bug

In the provided repro, child client WithExpand is missing the expand parameter in its clientInitialization.parameters array.

Reproduction

import "@azure-tools/typespec-client-generator-core";
import "@typespec/http";

using TypeSpec.Http;
using Azure.ClientGenerator.Core;

@service(#{
  title: "Test optional client param is propagated",
})
namespace ClientOptionalParams {
  model ExpandParameter {
    @query("$expand")
    $expand?: string;
  }

  namespace WithExpand {
    @route("/with")
    op test(@query("$expand")$expand?: string): void;
  }

  namespace WithoutExpand {
    @route("/without")
    op test(): void;
  }
}

@@clientInitialization(ClientOptionalParams,
  {
    parameters: ClientOptionalParams.ExpandParameter,
  },
);

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For bug in the typespec language or core libraries file it in the TypeSpec repo
  • Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinglib:tcgcIssues for @azure-tools/typespec-client-generator-core library

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions