-
-
Notifications
You must be signed in to change notification settings - Fork 168
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
🐛 Bug Report:
The generation of file from this configuration has broken in V2.10.0 (but worked fine in V.2.9.0 or previous)
{
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.2.0",
"generators": {
"my-application": {
"generatorName": "typescript-angular",
"output": "generated-sources/openapi",
"inputSpec": "http://localhost:8080/***.yaml",
"auth": "Authorization:*****",
"typeMappings": {
"DateTime": "Date"
},
"additionalProperties": {
"supportsES6": true,
"withInterfaces": true
}
}
}
}
}
When run from CLI
openapi-generator-cli generate --generator-key my-application
get this error
[[my-application] http://localhost:8080/***.yaml] La sintassi del nome del file, della directory o del volume non � corretta.
[[my-application] http://localhost:8080/***.yaml] C:\...\jdk-11.0.18/bin/java" -jar "D:\...\node_modules\@openapitools\openapi-generator-cli\versions\7.2.0.jar" generate --input-spec="ht
tp://localhost:8080/***.yaml" --generator-name="typescript-angular" --output="generated-sources/openapi" --auth="Authorization:***" --type-mappings="DateTime=Date" --additional-properties="
supportsES6=true,withInterfaces=true exited with code 1
[brd] http://localhost:8080/***.yaml
C:\***\jdk-11.0.18/bin/java" -jar "D:\***\node_modules\@openapitools\openapi-generator-cli\versions\7.2.0.jar" generate --input-spec="http://localhost:8080/***.yaml" --gener
ator-name="typescript-angular" --output="generated-sources/openapi" --auth="***" --type-mappings="DateTime=Date" --additional-properties="supportsES6=true,withInterfaces=true
Code generation failed
Process finished with exit code 1
If i'm rollback to 2.9.0 all work fine
jase88, zakupower and bartolomej
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
hassmal commentedon Mar 5, 2024
Same problem here
jase88 commentedon Mar 5, 2024
Seems to be Windows specific?
hassmal commentedon Mar 5, 2024
maybe, I'm also on windows
kemotx90 commentedon Mar 5, 2024
I'm on windows too
zakupower commentedon Mar 5, 2024
Same issue on Windows
wing328 commentedon Mar 5, 2024
thanks for reporting the issue.
@mok-liee can you please take a look when you've time?
related PR: #756
wing328 commentedon Mar 5, 2024
As a workaround, please rollback to 2.9.0 for the time being.
fix: use path.join for generating java bin path
mok-liee commentedon Mar 5, 2024
i can understand the problem but unfortunately i can't reproduce it in my windows environment.
but i think that using
path.join
should solve the problem. sorry for thatmok-liee commentedon Mar 5, 2024
@kemotx90 can u give me please more information about your environment?
version of windows, node, npm/yarn, java and the output of
echo %JAVA_HOME%
would be helpful.here is an output of mine with v2.10.0 with
cmd
. almost the same result withgit-bash
.mok-liee commentedon Mar 5, 2024
okay, i can reproduce it now. it seems to behave differently if you start the generation via the openapitools.json. i'll take a look at it.
mok-liee commentedon Mar 5, 2024
to pinpoint it a little bit, i think that
concurrently
doesn't like how the command is passedmok-liee commentedon Mar 6, 2024
@wing328 I think without a windows build workflow it is difficult to determine whether it runs under windows.
except for one test, i have been able to recreate the build plan for windows.
branch:
https://github.com/mok-liee/openapi-generator-cli/tree/feature/add-windows-to-build
compare:
mok-liee/openapi-generator-cli@patch-2...mok-liee:openapi-generator-cli:feature/add-windows-to-build
also i have added a
generate
test withJAVA_HOME
(it was the default) and now without.i need an understanding of the following test:
npm run oa:generate && mkdir ./foo && cd ./foo && npm run oa:generate
the last
npm run oa:generate
, is it correct that thegenerate
command must find theopenapitools.json
in the parent folder?if this is the case, i unfortunately cannot find where this logic is located. can you help me?
here you can see (i hope) my last build https://github.com/mok-liee/openapi-generator-cli/actions/runs/8164577233/job/22320124191
windows does not seem to look in the parent folder.
i think this could be the last step to get this thing running.
mok-liee commentedon Mar 6, 2024
i think i have it
openapi-generator-cli/apps/generator-cli/src/app/services/config.service.ts
Line 10 in 5d0e7c0
process.env.PWD
returns on Unix the parent directory and under Windows nothingprocess.env.INIT_CWD
returns on both thefoo
directoryprocess.cwd()
returns on both the parent directoryfix is in 15ac43e but because it is not enough there is another problem
https://github.com/mok-liee/openapi-generator-cli/actions/runs/8165673935/job/22323245537
i will continue the days
wing328 commentedon Mar 6, 2024
thanks @mok-liee I'll revert the change for the time being.
wing328 commentedon Mar 6, 2024
reverted, please install the latest release: https://github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.11.0
fix: use path.join for generating java bin path