Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #3542
Closed
Open
Issue created Aug 02, 2019 by Administrator@rootContributor5 of 5 checklist items completed5/5 checklist items

[BUG][typescript-angular] fails with java.lang.ClassCastException

Created by: LucaVazz

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used? Occurs both for 4.0.3 and 4.1.0-20190802.113338-103
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output? expected: a client gets generated actual:
[main] WARN  o.o.c.ignore.CodegenIgnoreProcessor - Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated. [main] INFO  o.o.codegen.DefaultGenerator - OpenAPI Generator: typescript-angular (client)
[main] INFO  o.o.codegen.DefaultGenerator - Generator 'typescript-angular' is considered stable.
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] WARN  o.o.codegen.utils.ModelUtils - Multiple schemas found in content, returning only the first one
[main] INFO  o.o.c.l.AbstractTypeScriptClientCodegen - Hint: Environment variable 'TS_POST_PROCESS_FILE' (optional) not defined. E.g. to format the source code, please try 'export TS_POST_PROCESS_FILE="/usr/local/bin/prettier --write"' (Linux/Mac)
[main] INFO  o.o.c.l.AbstractTypeScriptClientCodegen - Note: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).
Exception in thread "main" java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String
        at org.openapitools.codegen.languages.TypeScriptAngularClientCodegen.processOpts(TypeScriptAngularClientCodegen.java:169)
        at org.openapitools.codegen.DefaultGenerator.configureGeneratorProperties(DefaultGenerator.java:194)
        at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:908)
        at org.openapitools.codegen.cmd.Generate.run(Generate.java:399)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:60)
Description

While generating a TypeScript-Angular client, the generate command fails with java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String

openapi-generator version

Occurs both for 4.0.3 and 4.1.0-20190802.113338-103

OpenAPI declaration file content or url

https://petstore.swagger.io/v2/swagger.json

Command line used for generation
java -jar openapi-generator-cli.jar generate \
    -i https://petstore.swagger.io/v2/swagger.json \
    -g typescript-angular -c swagger-codegen-config.json --skip-validate-spec \
    -o ./lib/client
Steps to reproduce

swagger-codegen-config.json

{
    "sortParamsByRequiredFlag": true,
    "ensureUniqueParams": true,
    "allowUnicodeIdentifiers": true,
    "modelPropertyNaming": "camelCase",
    "supportsES6": true,
    "withInterfaces": false,
    "taggedUnions": true,
    "providedInRoot": false,
    "fileNaming": "kebab-case",
    "ngVersion": "7.0.0"
}
Related issues/PRs

I was only able to find #2709 (closed) which has the same error but the solution doesn't seem to apply for this bug.

Suggest a fix

I'll look into it more in depth next week. If someone has an idea / suggestion how to fix it before, feel free to comment and point me in the right direction.

Assignee
Assign to
Time tracking