Skip to content

[Bug]: @typespec/[email protected] crashes if namespace includes templated model #7828

@widal001

Description

@widal001

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:

Image

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:

Image

Checklist

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions