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
  • #3120
Closed
Open
Issue created Jun 07, 2019 by Jim Schubert@jimschubertContributor5 of 6 checklist items completed5/6 checklist items

[bug][finch] Infrastructure classes are output to /scala folder

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

Types are written to the scala folder rather than a standard package folder structure (as defined by packageName).

For example, defining:

  • packageName=org.openapitools.finchy
  • apiPackage=org.openapitools.finchy.apis
  • modelPackage=org.openapitools.finchy.models
image
openapi-generator version

4.0.0, possibly affects earlier versions

OpenAPI declaration file content or url

https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v2.0/json/api-with-examples.json

Command line used for generation
OPENAPI_GENERATOR_VERSION=4.0.0 openapi-generator generate \
  -g scala-finch \
  -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/json/api-with-examples.json \
  -o finchy \
  --additional-properties=packageName=org.openapitools.finchy,apiPackage=org.openapitools.finchy.apis,modelPackage=org.openapitools.finchy.models

where openapi-generator is our launcher script (https://github.com/OpenAPITools/openapi-generator/blob/master/bin/utils/openapi-generator-cli.sh)

Steps to reproduce

Generate using command above, inspect output:

[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: scala-finch (server)
[main] INFO  o.o.codegen.DefaultGenerator - Generator 'scala-finch' is considered stable.
[main] WARN  o.o.codegen.utils.URLPathUtils - 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
[main] WARN  o.o.codegen.utils.URLPathUtils - 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
[main] WARN  o.o.codegen.utils.URLPathUtils - 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/src/main/scala/org/openapitools/finchy/apis/DefaultApi.scala
[main] WARN  o.o.codegen.utils.URLPathUtils - 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/README.md
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/build.sbt
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/src/main/scala/Server.scala
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/src/main/scala/DataAccessor.scala
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/project/build.properties
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/project/plugins.sbt
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/sbt
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/src/main/scala/endpoint.scala
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/src/main/scala/errors.scala
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/.openapi-generator-ignore
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/jim/projects/openapi-generator/.bak/finchy/.openapi-generator/VERSION
Suggest a fix

Set the target folder for infrastructural types to the package output path.

Assignee
Assign to
Time tracking