ts-json-schema-generator
ts-json-schema-generator copied to clipboard
bug: Identifiers can't be parsed cross module boundaries
This is a minimal reproduction of existing behavior around the NodeParser throwing an UnknownNodeError for valid in scope identifiers.
eg.
// module.ts
const y = "hello";
export const x = {
z: y,
};
// main.ts
import { x } from "./module";
type Identifier = typeof x;
export interface MyObject {
field: Identifier;
}
Error:
Unknown node " y" of kind "Identifier"
My expectation of is that this would be able to be parsed - as this kind of type inference via an identifier is a common use case.
Thanks for the repro. This will Haley confirm the fix later.