Reading Time: 2 minutes
Hello All, In this blog we are using Swagger to generate document of Akka-HTTP.
For Swagger you can get more information from Introduction to Swagger .
For Akka you can get more information from Introduction to Akka-Http
You can find complete code here.
build.sbt file of the project contains all dependency.
SwaggerDocService.scala
AkkaSwagger.Scala
Get the Json in response by hitting localhost:8080/api-docs/swagger.json
You can get the document by pasting json on http://editor.swagger.io/#/
Resources
Thanks !!!
Reblogged this on imsonublog.
Reblogged this on Dhirendra.
Reblogged this on bigtechnologies.
I tried your example, it ran successfully but when I integrated the same code in my project it is generating error :
[ERROR] [11/14/2017 14:56:25.250] [akka-http-sample-akka.actor.default-dispatcher-3] [akka.actor.ActorSystemImpl(akka-http-sample)] Error during processing of request: ‘io.swagger.converter.ModelConverter: Provider io.swagger.scala.converter.SwaggerScalaModelConverter could not be instantiated’.
java.util.ServiceConfigurationError: io.swagger.converter.ModelConverter: Provider
io.swagger.scala.converter.SwaggerScalaModelConverter could not be instantiated
at java.util.ServiceLoader.fail(ServiceLoader.java:232)
Please let me know if this can be solved…