openapi-generator
openapi-generator copied to clipboard
[BUG] batch with asterisk filename does not work in docker
- 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
- 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.
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.