devonfw / cobigen

Code-based Incremental Generator
Apache License 2.0
35 stars 70 forks source link

Cobigen CLI does not generate files from an openapi source file outside of the project "src" folder #1275

Open jan-vcapgemini opened 4 years ago

jan-vcapgemini commented 4 years ago

Expected behavior

As a CobiGen CLI user, I want to use the "generate" command from any directory when generating code from openapi files.

Actual behavior

When using the "generate" command with an openapi file outside of the project "src" folder, the console states that the generation was successful, but no files were actually generated.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. Checkout: https://github.com/devonfw/devon4ng-application-template.git
  2. Place an openapi source file (taken from: https://github.com/devonfw/cobigen/wiki/files/devonfw.yml) into your project root directory (outside of src)
  3. Run: "devon cobigen generate devonfw.yml"
  4. Choose (8) CRUD devon4ng Service Based Angular
  5. Wait for "Successfull generation"
  6. Check in your output folders if "src/environments/environments.ts" was overwritten

Related/Dependent Issues

Comments/Hints:

Providing an output directory (using: -o src) will successfully generate the files. Moving the openapi source file into the project "src" folder will also generate the files.

Affected versions:

CobiGen CLI 7.0.0 openapipugin 7.0.0 templates-devon4j 20.08.001

LarsReinken commented 3 years ago

The behavior in the current release(2021.08.002) differs. The Generation just works with a given output directory, otherwise I get an NullPointerException: image the NullPointerException might have the same root cause as the following bug: https://github.com/devonfw/cobigen/issues/1389