Swagger API not rendering in order at GUI - java

I have developed REST api using scala and spray. for documentation I am using Swagger API for listing all apis.
at home page. host:port/index.html , where all apis are listed, They are not coming in order,I am supposed to diplay version vise apis like version
1.0.0,
1.0.1,
2.0.0,
It seems they come randomly, I have also used position parameter in #API but seems not working, how would I provide proper ordering of apis.

Ordering of paths has been removed in Swagger v2.0, see discussions below.
https://github.com/swagger-api/swagger-core/issues/1050
https://github.com/swagger-api/swagger-core/issues/1151
Possible alternatives include:
go back to swagger 1.2
use of tags to better organize resources
locally change swagger-core as suggested in issue 1151
try to re-open the issue once more :)

Related

Generating HTML documentation with Swagger 2.x via Maven

I am looking at generating some API documentation, hopefully using Swagger, in a few different projects of mine. Having never used Swagger, I am trying to find a very simple solution to generating HTML documents via Maven.
The underlying REST framework being used in these projects is Jersey. I found documentation from Swagger but it doesn't seem to have any examples of simply producing HTML files. Most of their examples seem to embed the API documentation into the actual service itself.
So my questions are:
How can I generate HTML documentation with Swagger via Maven?
Is attaching the documentation along with the service normal to do with REST applications?
You will need to use swagger-codegen to generate an HTML.
https://github.com/swagger-api/swagger-codegen#generating-static-html-api-documentation
To generate the HTML doc with swagger-codegen, you will first need to generate an OpenAPI documentation. Since you are already using Jersey as your REST framework, it is probably the easiest to pull in swagger as a dependency into your project and annotate all your API servlets. Doing so, will tell swagger to read all your code and generate an OpenAPI spec. You can follow the steps in https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Integration-and-Configuration to get started.
Good luck!

Offline swagger documentation using maven plugin

I am trying to generate swagger documentation, for that I need to start the server. I Want to generate swagger documentation offline (with out starting the server), I just got this link swagger-codegen-maven-plugin
But when I added above plugin to POM.xml (Suppose to generate HTML doc during maven build i feel), it is not at all doing anything. Please help.
Take a look at this plugin:
https://github.com/teamcarma/swagger-jaxrs-doclet
As the JSON resource listing is generated offline from source code it means that you do not need to add any runtime dependencies to your project and avoid potential headaches with different jar versions and jaxrs implementations. This also avoids increasing the size of your artifacts
To generate the HTML documentation, you need to set the value of the language tag in the configuration to HTML. In the example from your link, it is set to java. Change it to html. If you need both Java and HTML to be generated, have two execution blocks, one for Java, one for HTML.

Java or JavaScript library to generate HTML from Swagger, RAML or API Blueprint

Problem:
I am searching for a library in Java or JavaScript (or maybe Scala) which is able to generate an HTML representation of Swagger, RAML or API Blueprint input.
Background:
The idea is to use it as a part of a (Play Framework) web app serving as an API catalog. API specifications would be added by users of the API catalog and resulting HTML representations would be generated/displayed.
It would give extra value if a API specification stub also is possible to create using a Java API. The API catalog web app has a data model which I would like to use when generating the API stubs.
Furthermore, it would give extra value if the same (or related another) library provided a nice HTML editor of the API specification language (Swagger, RAML, API Blueprint etc) supporting the user while editing.
Swagger offers a set of tools to do it.
Swagger-Core will enable you to produce Swagger documentation from your Play code. This is done at runtime and will change as your application changes.
Swagger-UI will read such docs and display them in an HTML format. It also allows you to execute the operations and has integration with security mechanisms if needed. The UI can be customized to have the look-and-feel of your application (like many have done so far).
Swagger-Editor allows for direct editing of Swagger documentation with interactive side-by-side view of the docs in an HTML format.
Swagger-Codegen can take such a documentation and generate both client and server code. You can customize the templates to suit your needs.
There are several tools for for generating HTML from an API Blueprint, one of which is in Coffeescript and is called Aglio. You can see all of the tools here:
http://apiblueprint.org/
Also, Apiary is a service that uses API Blueprint and can be used for editing and hosting generated documentation, hooking up with Github to auto-generate from commits, providing some mocking APIs and some other cool stuff for teams and enterprises. You could check it out if you're wanting a solid service for your API documentation.
For RAML you have:
- https://github.com/kevinrenskers/raml2html
- https://github.com/mikestowe/php-raml2html
Give those a try ;)

GWTCanvas doesn't work in IE8

We heavily use GWTCanvas in our project and it work excellent.
Except for IE8 in its standard document mode.
To solve this we have tried:
Update gwt-incubator to the latest version (2.1.0)
Patch GWTCanvas.java according to this link
But this didn't help. Has anybody make it works on IE8? Working and reliable solution/approach would be much appreciated.
UPDATE
It has been solved in this way:
patch excanvas.js and inject it into your GWT class
replace GWTCanvasImpl with your class via deffered binding in proper gwt.xml file
Hope this helps someone.
GWTCanvas uses the SVG specification to implement the vector objects on a given GWT site.
Although almost every other browser (Firefox, chrome and Opera and I am sure many others) have implemented the SVG one way or another, Ms does not support svg on a sufficient level yet.
Maybe including http://code.google.com/p/svgweb/ google javascript library implementation of SVG will solve your problems but then again it might not (have not tested it personally).
A different implementation of Vector Graphics fro GWT - gwt-graphics is another solution but again, if your vector objects are many, the emulation on IE gwt-graphics does make the applications not-responsive and just plain slow (personal experience).

Missing APIs in Google Tasks API Java library

I'm trying to write a Tasks app for Android, using the v1.3 library here:
http://code.google.com/p/google-api-java-client/source/browse/com/google/?repo=mavenrepo&r=07a469e9e478c9e13e375c4d569436d4e261c59c#google%2Fapis%2Fgoogle-api-services-tasks%2Fv1-1.3.0-beta
As per the Javadoc, the TaskList class has a getUpdated() API, returning the last-modification time of the list. However, it's missing in the library and I need this API. Any reason why it's missing and how I can get it?
The API was added in v1.6 of the library. Not sure why it was missing before.

Categories