Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Typescript incorrect when referencing an alias of a map #89

Open
rherms opened this issue May 30, 2019 · 2 comments
Open

Generated Typescript incorrect when referencing an alias of a map #89

rherms opened this issue May 30, 2019 · 2 comments

Comments

@rherms
Copy link

rherms commented May 30, 2019

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 };
}
@iamdanfox iamdanfox transferred this issue from palantir/conjure Jun 3, 2019
@ferozco
Copy link
Contributor

ferozco commented Jun 3, 2019

I'm improving our testing story with #90 then I'll follow up with a fix

@ferozco
Copy link
Contributor

ferozco commented Jun 4, 2019

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants