您可以使用。\ swagger-codegen-cli.jar生成以生成与Swagger-Codegen-CLI同一文件夹中不在同一文件夹中的文件吗?
使用Java -jar。 。但是,.json文件必须与
swagger-codegen-cli
在同一文件夹中,当您要转换许多文件时,这是不切实际的(您必须手动下载并移动每个文件)。我已经搜寻了网络,但是找不到实用的解决方案。有办法这样做吗?我是否能够以“大规模生产”文件的方式集成Swagger-codegen?我知道我可以更改输出目录(-o),但这不是我想要的。说我有一个名为“脚本”的文件夹,其中我有很多.json文件。我是否可以在该文件夹内部的任何文件上调用Swagger-Codegen-cli生成
,即使Swagger> Swagger-Codegen-Cli
位于其他文件夹中?
Using java -jar .\swagger-codegen-cli.jar generate -l typescript-angular -i .\swagger.json
, I can turn ".\swagger.json" into a typescript-angular file. However, the .json file must be in the same folder as the swagger-codegen-cli
, which is impractical when you have many files to convert (You have to manually download and move every file). I've scoured the web, but haven't been able to find a practical solution. Is there a way to do this? Am I able to integrate swagger-codegen in such a way that I can "mass produce" files? I know I can change the output directory (-o) but that isn't what I'm looking for. Say I have a folder called "scripts" where I've got a lot of .json files. Am I able to call swagger-codegen-cli generate
on any file inside of that folder, even if swagger-codegen-cli
is located in a different folder?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
-i
参数期望OpenAPI文件或该文件所在的URL完全合格或相对路径。也就是说,该文件不必与Swagger Codegen CLI在同一文件夹中。示例:
The
-i
argument expects a fully-qualified or relative path to an OpenAPI file, or an URL where that file is located. That is, the file does not have to be in the same folder as the Swagger Codegen CLI.Examples: