0

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 ! (uses oktthp only)

Also i tried to download the json file from swagger hub (Export -> Download Api) and followed the steps here

RX JAVA + Retrofit sdk generation using Swagger codegen

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 ?

user2469133
  • 1,940
  • 3
  • 21
  • 33
  • Please contact SwaggerHub support: https://support.smartbear.com/message/?prod=SwaggerHub – Helen Oct 11 '19 at 12:48

1 Answers1

0

I could not manage to export client apis with rxjava and retrofit directly from swagger hub. However i found out that the tool that used to make code generation by command line (code generator cli) is now called (openapi cli).

And now by looking again to this answer :

https://stackoverflow.com/a/41086671/2469133

Use the same command mentioned in the answer , but :

Download openapi cli from here :

https://mvnrepository.com/artifact/org.openapitools/openapi-generator-cli/4.1.3

Use:

openapi cli jar file instead of code generator cli jar file.

and

"-g" instead of "-l"
user2469133
  • 1,940
  • 3
  • 21
  • 33