I am trying to the following in a bat file, in Windows, using OpenAPI generator:
openapi-generator generate -i open-api-offline-file.json -g csharp-netcore -c open-api-config.json -o DataLakeOpenApiRestClient
REM customizing ApiClient
xcopy .\SourcesCustomizations\ApiClient.cs .\DataLakeOpenApiRestClient\src\Org.OpenAPITools\Client\ApiClient.cs* /Y /F /R
This only generates the code without running the second command (or it is run before the generation ends).
If I start the generation with start /wait
:
start /wait openapi-generator generate -i open-api-offline-file.json -g csharp-netcore -c open-api-config.json -o DataLakeOpenApiRestClient
REM customizing ApiClient
xcopy .\SourcesCustomizations\ApiClient.cs .\DataLakeOpenApiRestClient\src\Org.OpenAPITools\Client\ApiClient.cs* /Y /F /R
it kind of works as expected (explicitly starts a new process and waits for it to exit).
Question: Is there a way to configure OpenAPI Generator to run synchronously?