Skip to content

[Bug]: openapi-generator-cli always use "current" folder as base when pass in relative path as parameter #6714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
thiamteck opened this issue Apr 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@thiamteck
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues/PRs to ensure it has not already been reported or fixed.
  • I have verified that I am using the latest version of Scoop and corresponding bucket.

Package Name

openapi-generator-cli

Expected/Current Behaviour

Expected:

relative path parameter value shall make openapi-generator-cli read from path that relative from current working directory.

Current

it is currently relative to "C:\Users\my_username\scoop\apps\openapi-generator-cli\current" instead of current working directory.

Steps to Reproduce

openapi-generator-cli generate -i .\sample.yaml -g java --library restclient -o .\client\java\sample-client 

will produce error as below even sample.yaml in the working directory:

 openapi-generator-cli generate -i .\sample.yaml -g java --library restclient -o .\client\java\sample-client
[error] The spec file is not found: .\sample.yaml
[error] Check the path of the OpenAPI spec and try again.

Possible Solution

I notice the openapi-generator-cli.cmd are as below:

@rem C:\Users\my_username\scoop\apps\openapi-generator-cli\current\openapi-generator-cli.jar
@pushd C:\Users\my_username\scoop\apps\openapi-generator-cli\current
@java -jar "C:\Users\my_username\scoop\apps\openapi-generator-cli\current\openapi-generator-cli.jar"  %*
@popd

I removed pushd and popd, then it work as expected:

@rem C:\Users\my_username\scoop\apps\openapi-generator-cli\current\openapi-generator-cli.jar
@java -jar "C:\Users\my_username\scoop\apps\openapi-generator-cli\current\openapi-generator-cli.jar"  %*

Scoop and Buckets Version

PS> scoop --version
Current Scoop version:
859d1db5 (HEAD -> master, tag: v0.5.2, origin/master, origin/HEAD) chore(release): Bump to version 0.5.2 (#6080)

'main' bucket:
2ea22d861 (HEAD -> master, origin/master, origin/HEAD) sqruff: Update to version 0.25.28

'extras' bucket:
425a87fc2f (HEAD -> master, origin/master, origin/HEAD) [email protected]: Fix hash (Closes #15293)

Scoop Config

PS> scoop config

last_update                       scoop_repo                              scoop_branch
-----------                       ----------                              ------------
2025-04-14T11:40:48.8348118+08:00 https://github.com/ScoopInstaller/Scoop master

PowerShell Version

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.2506
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2506
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Additional Softwares

No response

@thiamteck thiamteck added the bug Something isn't working label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant