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

[TCGC] Will TCGC support multiple services in one tsp #830

Open
chunyu3 opened this issue May 14, 2024 · 0 comments
Open

[TCGC] Will TCGC support multiple services in one tsp #830

chunyu3 opened this issue May 14, 2024 · 0 comments
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@chunyu3
Copy link
Member

chunyu3 commented May 14, 2024

Current, tcgc emit a type with one sdkPackage which present one service (api-versions, authentication, clients)
image

When there are multiple-services in one tsp (see following example), tcgc will only return the first service.
Will tcgc support multiple-services or not? if so, tcgc need to emit multiple sdkPackage. If not, maybe we need to add lint-rule to avoid.

@versioned(Versions1)
@service({
  title: "HttpbinServer",
  version: "1.0.0",
})
@server(
  "https://{domain}.{tld}",
  "Httpbin endpoint",
  {
    @doc("second-level domain, use httpbin")
    domain?: string = "httpbin",

    @doc("top-level domain, use org")
    tld?: string = "org",
  }
)
namespace Typespec.Server {
  @route("/status/{code}")
  interface ServerOp {
    status(@path code: int32): OkResponse | NoContentResponse;
  }
}
enum Versions1 {
    @useDependency(Azure.Core.Versions.v1_0_Preview_1)
    "2022-05-15-preview"
  }

enum APIVersions {
    v1: "v1",
  }

@versioned(APIVersions )
@service({
  title: "ContosoServer",
})
@server(
  "{Endpoint}/contoso/{ApiVersion}",
  "Service endpoint",
  {
    @doc("Service endpoint")
    Endpoint: string,

    @doc("Api Version")
    @path
    ApiVersion: APIVersions,
  }
)
namespace ContosoServer {

  @route("/contoso")
  interface ServerOp {
    get(@path code: int32): OkResponse | NoContentResponse;
  }
}
@chunyu3 chunyu3 added the lib:tcgc Issues for @azure-tools/typespec-client-generator-core library label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

No branches or pull requests

2 participants