Page MenuHomePhabricator

Integrate SwaggerUI with the service template
Closed, ResolvedPublic


The service template makes use of Swagger specifications in order to automatically test the service during the test phase as well as ensure that the service checker script we have in production can be used to monitor it regularly.

Even though we use Swagger, the service template itself does not automatically expose the information contained in the specification in a nice self-documented way via swagger-ui library.

That can be accomplished with the SwaggerUI package to obtain a result similar to Wikipedia's REST API documentation. We need to integrate it in the service template.

The implementation should be pretty straightforward. A route needs to be defined that would statically serve the dist content of the swagger-ui lib, possibly making some amendments on it, just like we do for RESTBase, and example could be found here. The JSON spec should also be statically exposed, and the swagger-ui lib should be configured to request the JSON spec.

Mentors: @mobrovac and @Pchelolo

Event Timeline

mobrovac created this task.Nov 8 2016, 7:58 PM
Restricted Application added subscribers: TerraCodes, Aklapper. · View Herald TranscriptNov 8 2016, 7:58 PM
mobrovac updated the task description. (Show Details)
Pchelolo updated the task description. (Show Details)Nov 11 2016, 9:45 PM

Task completed. Link to github pull request:
If anything is wrong, please tell and I will fix it.
Actually, there can be some problems with code style. And I am not sure if url ('/api') is suitable location for swagger-ui.

mobrovac closed this task as Resolved.Dec 22 2016, 11:40 AM
mobrovac assigned this task to nikitavbv.
mobrovac edited projects, added Services (done); removed Services (later).

The task has been completed. Thank you @Phantom42 ! Resolving.