openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[BUG] batch with asterisk filename does not work in docker

Open leonidumanskiy opened this issue 2 years ago • 1 comments

  1. Follow example steps from the documentation https://openapi-generator.tech/docs/usage#batch (ignore for now that documentation is outdated and references csharp-netcore which was renamed)
> ls
csharp.yaml  kotlin.yaml  shared

> openapi-generator-cli batch *.yaml
...
[pool-1-thread-2] Finished generating kotlin…
[FAIL] Completed with 1 failures, 1 successes
  1. Now, try the same command with docker:
> docker run -v ${PWD}:/local openapitools/openapi-generator-cli batch *.yaml
...
[main] ERROR o.o.c.config.CodegenConfigurator - csharp.yaml (No such file or directory)

For whatever reason, wildcard/asterisk resolution just does not seem to work with docker setup.

> docker run -v ${PWD}:/local openapitools/openapi-generator-cli batch /local/*.yaml
...
[main] ERROR o.o.c.config.CodegenConfigurator - /local/*.yaml (No such file or directory)

However, the direct resolution works:

> docker run -v ${PWD}:/local openapitools/openapi-generator-cli batch /local/kotlin.yaml
...
[SUCCESS] Batch generation finished 1 generators successfully.

What's even more strange to me, that the original "java -jar ..." command issued by docker-entrypoint.sh does not work unless wrapped in sh -c which suggest some entrypoint issue? Setting root directory or includes base dir does not resolve the issue.

leonidumanskiy avatar Dec 30 '23 05:12 leonidumanskiy

Apparently you can chain the yaml files as arguments docker run -v ${PWD}:/local openapitools/openapi-generator-cli batch /local/kotlin.yaml /local/something.yaml

Not as convenient as asterisk but at least it works.

ArthurGoupil avatar Aug 26 '24 19:08 ArthurGoupil