0

I just started poking into how swagger works with akka-http and I got up and running with the typesafe activator example called "Spray-Slick-Swagger Sample". This code is also available here.

Since this is an illustrative example I am guessing not all 'best practices' for sbt were followed. In particular, I noticed that all of the web resources for swagger were checked in to src/main/resources.

In a real project, I would like to be able to establish a dependency on swagger version "xxxx.whatever", and then I'd like sbt's dependency management facilities to download the appropriate web resources (in the swagger .jar), and then I'd like to execute some code to somehow crack open the depended-on swagger jar and extract the web resources into the right place (i.e., src/main/resources)...even better would be to leave these out of src/main/resources and put into target/...somewhere, so that a 'clean' operation makes the auto-generated stuff go away easily.

I'm guessing there has to be a plugin or some well known recipe for this. If anyone can point me to one that would be fantastic. Thanks !

Chris Bedford
  • 2,560
  • 3
  • 28
  • 60
  • You'd probably need to modify `index.html` to proper path unless your api is hosted in root uri path. Thus you might have to have your own copy of swagger-ui. – expert Sep 12 '15 at 21:52
  • gotcha... i would think a well written plugin would be able to take that info .. parameterized somehow, and use that to generate the index.html in such a way as to point to the right place... if i was better at sbt, i'd consider writing one myself.... maybe someday ;^) thanks for your comment. – Chris Bedford Sep 12 '15 at 22:43

0 Answers0