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
  • #3364
Closed
Open
Issue created Jul 15, 2019 by Administrator@rootContributor4 of 6 checklist items completed4/6 checklist items

[BUG] Option template directory ignored in 4.1.0-SNAPSHOT

Created by: MichalFoksa

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?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

Looks like template directory option (-t | --template-dir ) is ignored in 4.1.0-SNAPSHOT. Template directory always defaults to embeded dir.

Following condition from DefaultCodegen.processOpts() evaluates to false even when -t option is provided, e.g: -t swagger/my-template .

if (additionalProperties.containsKey(CodegenConstants.TEMPLATE_DIR))

I have added a log message right at the end of DefaultCodegen.processOpts() method: LOGGER.info("Template directory [templateDir={}]", this.templateDir());

Result message: [main] INFO o.o.codegen.DefaultCodegen - [Template directory [templateDir=openapi-yaml]

BTW: Same issue is with Spring generator.

openapi-generator version

4.1.0-SNAPSHOT as of 14/July/2019.

Steps to reproduce

java -jar "./modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -i swagger/openapi.yml -g openapi-yaml -t swagger/my-template --additional-properties outputFile=swagger/swagger.yml

Suggest a fix

It looks like there is a quite difference in code gen configuration (e.g.: CodegenConfigurator.java) between 4.0.x and 4.1.0.

I do not know what is a direction in 4.1.x.

Assignee
Assign to
Time tracking