refine api docs

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-10-22 18:43:14 +08:00
parent 44799ae68a
commit 496db42be6
36 changed files with 1725 additions and 2399 deletions

View File

@@ -12,7 +12,7 @@ func NewOpenAPIService(config Config) *restful.WebService {
ws := new(restful.WebService)
ws.Path(config.APIPath)
ws.Produces(restful.MIME_JSON)
if config.DisableCORS {
if !config.DisableCORS {
ws.Filter(enableCORS)
}
@@ -45,6 +45,7 @@ func BuildSwagger(config Config) *spec.Swagger {
}
swagger := &spec.Swagger{
SwaggerProps: spec.SwaggerProps{
Host: config.Host,
Swagger: "2.0",
Paths: paths,
Definitions: definitions,