teamcarma / swagger-jaxrs-doclet

This fork is no longer actively maintained, please switch to https://github.com/conorroche/swagger-doclet
Apache License 2.0
81 stars 38 forks source link

Problem with default index.html #40

Closed TuomasKiviaho closed 9 years ago

TuomasKiviaho commented 9 years ago

service.json is currently treaded as basepath by the swagger-ui but I believe it has not been so previously, because I have no idea how to produce a working without modifying the index.html and the history of swagger-ui gives impression that this has been altered somehow in the past.

My results have been (using @Api("/") public class Foobar)

If i try to access the index.html directly then I am getting path pointing to index.html/service.json

TuomasKiviaho commented 9 years ago

I got things working by manually prefixing the service.json paths as below

{
  "swaggerVersion" : "1.2",
  "apiVersion" : "0",
  "apis" : [ {
    "path" : "/../foobar.{format}"
  }, {
    "path" : "/../service.{format}"
  } ]
}
conorroche commented 9 years ago

can you tell me what you are using for the apiBasePath and docBasePath in the maven pom.xml and can you confirm which version of the doclet you are using?

TuomasKiviaho commented 9 years ago

Rookie mistake. I got overly anxious about this serverless approach and forgot that AJAX doesn't work over file protocol. Shred http client mutilated the port but I didn't figure this one out until useJQuery: true started giving what appeared to be cross site scripting error. Sorry about the hassle.

TuomasKiviaho commented 9 years ago

I used the javadoc:javadocmaven goal as per your example but Jenkins has a bad habit of not delivering the JavaDoc links when not using javadoc:aggregate (here it sort of treats every project as multimodule project).

Before figuring this out tried to use swagger from the Jenkins workspace directly, but swagger broke on me since workspace navigation doesn't(/mustn't) treat index.html as welcome page as normal web servers do.