-
Notifications
You must be signed in to change notification settings - Fork 310
[Bug]: @typespec/[email protected]
crashes if namespace includes templated model #7828
Copy link
Copy link
Closed
Labels
Milestone
Description
Describe the bug
After upgrading from v1.0.0 to v1.1.0 if I try to run tsp compile main.tsp --emit @typespec/json-schema
and the namespace decorated with @jsonSchema
contains a templated model, the compiler throws the following error:

Reproduction
Using the exact same code, but simply changing the versions reproduces the error:
import "@typespec/json-schema";
using JsonSchema;
@jsonSchema
namespace Schemas;
model Foo {
bar: string;
baz: string;
}
model Baz<T> {
bar: T;
foo: string;
}
Is crashing with this error:

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.