geeklearningio / gl-swagger-generator

Jane - An OpenAPI Specification (formerly Swagger) Client Generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to generate Dictionary property with Angular template

asiffermann opened this issue · comments

I have the following definition in my Swagger file:

"ClaimsSet": {
    "type": "object",
    "properties": {
        "claims": {
            "type": "object",
            "additionalProperties": {
                "type": "array",
                "items": {
                    "type": "string"
                }
            }
        }
    }
}

With the .NET generator, it is properly mapped to a Dictionary<string, string[]>, but with the Angular one, the type is not resolved.
So the generated TypeScript ends with that (and cannot be compiled):

/*ClaimsSet*/
export interface ClaimsSet  {

    /**/
    claims: ;

}

Is it related to generics' support?

No just dictionary support missing from the template, something like this should do the trick : https://github.com/geeklearningio/gl-swagger-generator/blob/feature/fix-ts-dictionnary/templates/typescript/angular/1.5/_typeCore.hbs

fixed in 5a9680c btw