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
  • #405
Closed
Open
Issue created Jun 26, 2018 by Administrator@rootContributor

[JAVA] Generating code is referencing a generated model class which is not created

Created by: Morac2

Description

Generating Java code from a YAML file is creating code that imports and uses a model class that is never being generated. In this case there are references to org.openapitools.client.model.DocumentCreateWithStreamRequest and org.openapitools.client.model.DocumentUpdateWithStreamRequest classes, but that model class is never created. The code does generate DocumentCreateRequest and DocumentUpdateRequest classes, but the code never uses them. It instead replaces them with their parent class Document. All 4 classes extend Document.

In addition the generated code doesn't check to see if any of the required fields are present. Basically the generated code doesn't even compile, let alone work correctly.

openapi-generator version

All versions from 3.0.2 to 4.0.0-SNAPSHOT (didn't test earlier versions)

OpenAPI declaration file content or url

https://gist.githubusercontent.com/Morac2/b0e4d02e50712082b72e4e72f7b8e3aa/raw/132e609fd599391a1c782bc3ea450883e6098219/test.yaml

Command line used for generation

java -jar openapi-generator-cli.jar generate -l java -i test.yaml -o test_code

Steps to reproduce

Generate code

Related issues/PRs

N/A

Suggest a fix/enhancement

Unknown

Assignee
Assign to
Time tracking