Skip to content

Commit c03d1e0

Browse files
Ernest MickleiErnest Micklei
Ernest Micklei
authored and
Ernest Micklei
committed
static file serving of swagger-ui is no longer part of this package.
1 parent c36cb6c commit c03d1e0

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

config.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package restfulspec
22

33
import (
4-
"net/http"
54
"reflect"
65

76
restful "github.com/emicklei/go-restful"
@@ -20,16 +19,10 @@ type Config struct {
2019
// WebServicesURL is the url where the services are available, e.g. http://localhost:8080
2120
// if left empty then the basePath of Swagger is taken from the actual request
2221
WebServicesURL string
23-
// APIPath is the path where the JSON api is avaiable , e.g. /apidocs
22+
// APIPath is the path where the JSON api is avaiable , e.g. /apidocs.json
2423
APIPath string
25-
// SwaggerPath [optional] where the swagger UI will be served, e.g. /swagger
26-
SwaggerPath string
27-
// SwaggerFilePath [optional] is the location of folder containing Swagger HTML5 application index.html
28-
SwaggerFilePath string
2924
// api listing is constructed from this list of restful WebServices.
3025
WebServices []*restful.WebService
31-
// will serve all static content (scripts,pages,images)
32-
StaticHandler http.Handler
3326
// [optional] on default CORS (Cross-Origin-Resource-Sharing) is enabled.
3427
DisableCORS bool
3528
// Top-level API version. Is reflected in the resource listing.

examples/user-resource.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,7 @@ func main() {
136136
},
137137
Version: "1.0.0",
138138
},
139-
},
140-
// Optionally, specifiy where the Swagger UI is located
141-
SwaggerPath: "/apidocs/",
142-
SwaggerFilePath: "/Users/emicklei/Projects/swagger-ui/dist"}
139+
}}
143140
restfulspec.RegisterOpenAPIService(config, restful.DefaultContainer)
144141

145142
log.Printf("start listening on localhost:8080")

0 commit comments

Comments
 (0)