8000 [Typescript] Utilise Typescript object spread vs custom extendObj method · Issue #4407 · swagger-api/swagger-codegen · GitHub
[go: up one dir, main page]

8000
Skip to content
[Typescript] Utilise Typescript object spread vs custom extendObj method #4407
@damienpontifex

Description

@damienpontifex
Description

Typescript 2.1 allows object spread (see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html#object-spread-and-rest). The Typescript templates currently define an extendObj method to achieve this same feature e.g. https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache#L44-L51

Swagger-codegen version

2.2.1

Suggest a Fix

Remove extendObj in api.mustache files and just utilise object rest operator.

I can provide a fix with a PR unless there's any reason not to...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0