Swagger Viewers that look like the editor preview show markdown

167 views
Skip to first unread message

Adam Moliski

unread,
Jun 4, 2015, 7:11:29 PM6/4/15
to swagger-sw...@googlegroups.com

(This is a repost, my first post disappeared- possibly because of a big number of links that could look like spam. I inlined the images and am trying another shot at submitting.)


First, I'd like to thank you guys for your work on this awesome tool, it's definitely saved me tons of time, and I discovered a dozen issues with my API while I was building the documentation. It turns out that whenever I hit a major frustration with representing my API with your documentation format, it ended up being because I was doing something dumb.


Now that my documentation is all squared away, I wanted to add a documentation viewer to my project UI example. I'm having trouble finding a renderer that will make the documentation look exactly like the preview in the interactive editor.

What I'm looking for is a standalone viewer that just shows the contents of the right pane here: 





My API docs made heavy use of markdown formatting- tables `code strings`, **bolding**, etc:  (Using the valid arguments table as my example):


When I export my swagger file as JSON and load it into the viewer, it looks like the below pic- It's not showing any of the markdown formatting, and the method formatting is shuffled (DELETE-GET-PUT instead of GET-PUT-POST-DELETE like it appears in the swagger file)



When I export it as YAML, the viewer fails to load it, getting stuck on 'fetching resource list':





When I use the Generate Client options for HTML and Dynamic HTML, I get the same issues of it not displaying markdown (or newlines):





Anyway, I am probably just missing an obvious option somewhere, but can someone please point me in right direction for getting a viewer that just looks like this?





Thanks!

Ron Ratovsky

unread,
Jun 4, 2015, 9:02:41 PM6/4/15
to swagger-sw...@googlegroups.com
Hi Adam,

The codegen templates are indeed lacking, and any contributions to make them better would be appreciated.
As for swagger-ui, please try the develop_2.0 branch, I think there may have been a related fix there.
If it still doesn't render properly, please open an ticket on the project and we'll look into it.

--
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.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

Adam Moliski

unread,
Jun 4, 2015, 9:22:53 PM6/4/15
to swagger-sw...@googlegroups.com
I just downloaded the latest code and I'm still getting the infinite 'fetching resource list' problem.
Console shows "Uncaught SyntaxError: Unexpected token #" - I'll put a bug ticket in for it.

I'll play with the code generators next week, at the very least I'll take a shot at one that generates what you see in the preview. The hard work's already done!

Ron Ratovsky

unread,
Jun 4, 2015, 9:24:11 PM6/4/15
to swagger-sw...@googlegroups.com

That could be unrelated though. Any chance you can share your Swagger definition so I can test it locally?

Adam Moliski

unread,
Jun 4, 2015, 9:25:29 PM6/4/15
to swagger-sw...@googlegroups.com
Sure, I'll shoot it to you in an email.

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/Fw42et5D2BU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swagger-swaggers...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages