OpenAPI spec does not work with swagger-codegen


(theduke) #1

It’s awesome that there is a official OpenAPI spec at https://docs.discourse.org/swagger.json.

BUT swagger-codegen, the goto tool for generating API clients, does not work with the spec.

It errors out with

"Exception in thread "main" java.lang.RuntimeException: missing swagger input or config!
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:731)
at io.swagger.codegen.cmd.Generate.run(Generate.java:285)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)"

This seems to be an indicator of a invalid spec (java.lang.RuntimeException: missing swagger input or config! (parse error?) · Issue #1351 · swagger-api/swagger-codegen · GitHub) or otherwise a bug in swagger, but probably the former.