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

problem with interface extends interface #130

Open
niklas-dahl opened this issue Oct 27, 2020 · 0 comments
Open

problem with interface extends interface #130

niklas-dahl opened this issue Oct 27, 2020 · 0 comments

Comments

@niklas-dahl
Copy link

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.

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

1 participant