[英]Swagger codegen RX JAVA + Retrofit not working
I tried to export RX JAVA + Retrofit client from swagger hub, by entering Codegen Options and enabling check box of (useRxJava2) in the java client, however when i export the java client it does not work as expected and the code doesn't have neither retrofit nor rx java ! I tried to export RX JAVA + Retrofit client from swagger hub, by entering Codegen Options and enabling check box of (useRxJava2) in the java client, however when i export the java client it does not work as expected and the code doesn't have既不是 retrofit 也不是 rx java ! (uses oktthp only) (仅使用 oktthp)
Also i tried to download the json file from swagger hub (Export -> Download Api) and followed the steps here我还尝试从 swagger 集线器(导出 - > 下载 Api)下载 json 文件并按照此处的步骤操作
RX JAVA + Retrofit sdk generation using Swagger codegen RX JAVA + Retrofit sdk 生成使用 Z336FF1E9AA6177EA7A71984FA8C241B 代码
But when i run the command, i get this in the command line:但是当我运行命令时,我在命令行中得到了这个:
[main] INFO io.swagger.parser.Swagger20Parser - reading from openapi.json
[main] INFO io.swagger.parser.Swagger20Parser - reading from openapi.json
[main] INFO io.swagger.codegen.ignore.CodegenIgnoreProcessor - No .swagger-codeg
en-ignore file found.
Exception in thread "main" java.lang.RuntimeException: missing swagger input or
config!
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:13
2)
at io.swagger.codegen.cmd.Generate.run(Generate.java:223)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:36)
Any clue how can i bypass this?任何线索我怎么能绕过这个?
I could not manage to export client apis with rxjava and retrofit directly from swagger hub.我无法直接从 swagger 集线器导出带有 rxjava 和 retrofit 的客户端 API。 However i found out that the tool that used to make code generation by command line (code generator cli) is now called (openapi cli).但是我发现用于通过命令行生成代码的工具(代码生成器 cli)现在被称为(openapi cli)。
And now by looking again to this answer:现在再次查看这个答案:
https://stackoverflow.com/a/41086671/2469133 https://stackoverflow.com/a/41086671/2469133
Use the same command mentioned in the answer, but:使用答案中提到的相同命令,但是:
Download openapi cli from here:从这里下载 openapi cli:
https://mvnrepository.com/artifact/org.openapitools/openapi-generator-cli/4.1.3 https://mvnrepository.com/artifact/org.openapitools/openapi-generator-cli/4.1.3
Use:利用:
openapi cli jar file instead of code generator cli jar file. openapi cli jar 文件而不是代码生成器 cli jar 文件。
and和
"-g" instead of "-l"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.