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

undefined and null types aren't transformed properly #26

Open
marcosvrs opened this issue May 7, 2019 · 2 comments
Open

undefined and null types aren't transformed properly #26

marcosvrs opened this issue May 7, 2019 · 2 comments
Assignees
Labels

Comments

@marcosvrs
Copy link
Collaborator

Code example:

interface ComplexTypesInterface {
    type: Dict<{ stringType: string; numberType: number; }> | undefined;
}

Current transformation:

@startuml
interface ComplexTypesInterface {
    type: Dict<{ stringType: string; numberType: number; }>
}
@enduml

Expected transformation:

@startuml
interface ComplexTypesInterface {
    type: Dict<{ stringType: string; numberType: number; }> | undefined
}
@enduml
@marcosvrs marcosvrs added the bug label May 7, 2019
@marcosvrs marcosvrs changed the title Union Types aren't transformed properly undefined and null types aren't transformed properly May 8, 2019
@bafolts bafolts self-assigned this May 20, 2019
@bafolts
Copy link
Owner

bafolts commented May 20, 2019

I can't reproduce this issue if I define Dict.

interface Dict<T> {
    public keys: T[];
}

interface ComplexTypesInterface {
    type: Dict<{ stringType: string; numberType: number; }> | undefined;
}

Generates

@startuml
interface Dict<T> {
    +keys: T[]
}
interface ComplexTypesInterface {
    +type: Dict<{ stringType: string; numberType: number; }> | undefined
}
@enduml

If I don't define Dict I get any as the type. @marcosvrs was this posted prior to merging the re-factor? I can't seem to recreate the issue.

@marcosvrs
Copy link
Collaborator Author

Interesting behavior. But actually my Dict interface looks like that:

interface Dict<T> {
    [index: string]: T;
}

You can also take a look in my last commit here where I could also reproduce it.

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

No branches or pull requests

2 participants