Skip to content

[typescript-angular] some models missing from api/*.service.ts imports -- 2.3.0 #7189

Open
@jacksloan

Description

@jacksloan
Description

additionalProperties models are not imported in generated typescript-angular api/*.service.ts files.

Swagger-codegen version

2.3.0

Swagger declaration file content or url
"responses": {
    "200": {
        "description": "OK",
        "schema": {
            "type": "object",
            "additionalProperties": {
                "type": "array",
                "items": {
                    "$ref": "#/definitions/MissingInServiceImports"
                }
            }
        }
    }
}

Entire swagger declaration file in this repo: https://github.com/jacksloan/broken-imports-typescript-codegen

Command line used for generation
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
    -i swagger-spec.json \
    -l typescript-angular \
    --additional-properties npmRepository=https://nexus.xyz.com/repository/npm-internal \
    --additional-properties npmName=codegen-xyz \
    --additional-properties npmVersion=0.0.1 \
    --additional-properties ngVersion=4.3.0
Steps to reproduce

Run typescript-angular codegen against the spec file here: https://github.com/jacksloan/broken-imports-typescript-codegen

Snapshot used: https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.3.0-SNAPSHOT/swagger-codegen-cli-2.3.0-20171216.033217-359.jar

Related issues/PRs

--

Suggest a fix/enhancement

I'll see what I can come up with. As a guess, could it be related to line 67-71 here?
https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions