Skip to content

Controller with array return type generates invalid typescript import #18

@joachim-heck

Description

@joachim-heck

I've just tested out the controller export feature and came across some weird generation behaviour:

Controller Endpoint:

[HttpGet, Route("string")]
public string[] GetStrings()
{
    return new List<string>().ToArray();
}

will be generated with a corrupt import definition: string[]

// ------------------------------------------------------------------------------
//  <auto-generated>
//      This code was generated with KY.Generator 5.0.1.0
//      Manual changes to this file may cause unexpected behavior in your application.
//      Manual changes to this file will be overwritten if the code is regenerated.
//  </auto-generated>
// ------------------------------------------------------------------------------
// tslint:disable

import { String[] } from "../api-models/string";


...

    public getStrings(httpOptions: {} = undefined): Observable<String[]> {
        let subject = new Subject<String[]>();
        this.http.get<String[]>(this.serviceUrl + "/api/v1/modelling", httpOptions).subscribe((result) => {
            subject.next(result);
            subject.complete();
        }, (error) => subject.error(error));
        return subject;
    }

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingnext releaseTry to add this issue to next release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions