Skip to content

problem with interface extends interface #130

@niklas-dahl

Description

@niklas-dahl

Hey, thanks for this package.
We are running into problems when extending interfaces.

Minimal problem reproduction:

types.ts

export interface Comment {
  comment: string;
}

export interface UserComment extends Comment {
  user: string;
}

routes.ts

@Path(":name")
  @POST
  async userComment(): Promise<UserComment> {
    return {
      user: "user",
      comment: "comment",
    };
  }

using the UserComment type results in the following error

/../typescriprestupdate/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:267
        throw err;
        ^

Error: Only string indexers are supported. Found double.
    at /../typescriprestupdate/node_modules/typescript-rest-swagger/dist/metadata/resolveType.js:507:23

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions