-
Notifications
You must be signed in to change notification settings - Fork 324
Closed
Labels
Milestone
Description
Describe the bug
The following spec in playground outputs in openapi3 format but the playground crashes when choosing TCGC output
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-client-generator-core";
import "@typespec/http";
import "@typespec/rest";
using global.Azure.Core.Foundations;
using Azure.ClientGenerator.Core;
using TypeSpec.Http;
using TypeSpec.Versioning;
@service(#{ title: "Contoso" })
namespace Contoso {
model GetUserOptions {
@query userid?: string;
@query zipcode?: string;
}
model User {
name: string;
age: int16;
}
@get
@route("/get-user")
op getUser(p: GetUserOptions) : User;
}
namespace Customization {
op getUserCustomization(
options?: Contoso.GetUserOptions,
): void;
@@override(Contoso.getUser, Customization.getUserCustomization);
}but if I slightly change the spec to the following, the TCGC output appears
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-client-generator-core";
import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
using global.Azure.Core.Foundations;
using Azure.ClientGenerator.Core;
using TypeSpec.Http;
using TypeSpec.Versioning;
@service(#{ title: "Contoso" })
@versioned(Versions)
namespace Contoso {
enum Versions {
@useDependency(global.Azure.Core.Versions.v1_0_Preview_2)
v2022_12_01_preview: "2022-12-01-preview",
}
model Options {
@query userid?: string;
@query zipcode?: string;
}
model User {
name: string;
age: uint16;
}
@get
@route("/get-user")
op getUser is global.Azure.Core.RpcOperation<Options, User>;
}
namespace Customization {
op getUserCustomization(
options?: Contoso.Options,
...ApiVersionParameter,
): void;
@@override(Contoso.getUser, Customization.getUserCustomization);
}Reproduction
Here is the link to the failing playground, go to the link and change output to TCGC
Checklist
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.