Java to JSON to HTML?

64 views
Skip to first unread message

rpa...@zymergen.com

unread,
Dec 12, 2017, 7:13:20 PM12/12/17
to Swagger
Hello,

I'm new to Swagger, and although I've done some trivial Java coding, I'm not a "real" programmer. My goal is to convert Java annotations that define a REST API to a JSON file, and then convert the JSON file to HTML documentation for the API. There's lots of information about what the JSON file format should be, and Swagger UI appears to be the right tool for the second conversion, but I'm unclear about the first. I'm probably missing something that would be obvious to a "real" programmer.

Codegen is described as a tool that "creates server stubs and client SDKs". Compared with what I'm hoping to do, this seems backwards. The REST API definitions are already in the Java code. I might need to make sure they are sufficiently complete to be used with Swagger, but they exist already. What should I do?

Rebecca

Ron Ratovsky

unread,
Dec 12, 2017, 8:50:34 PM12/12/17
to swagger-sw...@googlegroups.com

It really depends on which REST framework you use in Java. Jersey? RESTEasy? Spring? Something else?

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
swagger-swaggers...@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.

Rebecca Parks

unread,
Dec 13, 2017, 4:24:52 PM12/13/17
to swagger-sw...@googlegroups.com
Jersey and DropWizard are the frameworks. It turns out that the engineers can already use Swagger (presumably some utility in Codegen), but many of the Java REST annotations are in subclasses that Swagger misses. 

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/3LTjMsT8sIg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

rpa...@zymergen.com

unread,
Dec 19, 2017, 11:17:07 AM12/19/17
to Swagger
No one seems interested in this thread, but I'll try again anyway.

I've given up on the Java to JSON conversion. The Java code just isn't designed for it.

However, I could still use some help with the JSON to HTML conversion. Currently I'm using pretty-swag, but it's severely limited and I'd rather use something more feature-rich. But Codegen really makes you jump through a lot of hoops before you get your HTML output. Is there some simple way to make Codegen just generate HTML from a JSON file?

Rebecca

Calder Carey

unread,
Dec 19, 2017, 8:52:26 PM12/19/17
to swagger-sw...@googlegroups.com

--------------------------------------------
On Tue, 12/19/17, <rpa...@zymergen.com> wrote:

Subject: Re: Java to JSON to HTML?
To: "Swagger" <swagger-sw...@googlegroups.com>
Date: Tuesday, December 19, 2017, 7:17 PM
from it, send an email to swagger-swaggers...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
riasul entuziasm starnit de dubla alegere a lui Alexandru I.Cuza pretutindeni unde traiau romani nu putea in nici un fel sa ascunda situatia complexa in care se gasea noul stat.

PJ Fanning

unread,
Dec 20, 2017, 11:44:57 AM12/20/17
to Swagger
My team uses https://github.com/int128/gradle-swagger-generator-plugin in our project's gradle build to output swagger docs as HTML.
We use some custom gradle scripting to create the swagger yaml and run it through the grade-swagger-generator-plugin to create the HTML. The plugin seems to support yaml better than json but the swagger tooling can output yaml as easily as it can output json.
Reply all
Reply to author
Forward
0 new messages