conjure-typescript
conjure-typescript copied to clipboard
Generated Typescript incorrect when referencing an alias of a map
What happened?
The generated typescript code would not compile because of a missing import. Here is a simplification of my conjure:
Foo:
fields:
myField: Bar
Bar:
alias: map<string, Baz>
Baz:
union:
str: string
date: datetime
The generated code for Foo.ts did not import IBaz even though it referenced it. It looked something like:
export interface IFoo {
myField: { [key: string]: IBaz };
}
What did you want to happen?
Valid typescript to be generated, like:
import { IBaz } from "./Baz";
export interface IFoo {
myField: { [key: string]: IBaz };
}
I'm improving our testing story with #90 then I'll follow up with a fix
@rherms I've attempted to repro your issue, but I've been unable to. You can look at a my branch.
What version of conjure-typescript are you using? Can you point me in the direction of where you're seeing this issue?