optimize code

This commit is contained in:
MaxToby 2021-07-30 14:41:39 +08:00
parent 0e70444ab8
commit 05cdea3e7c

View File

@ -184,12 +184,14 @@ func renderServiceRoutes(service spec.Service, groups []spec.Group, paths swagge
requestResponseRefs[param.Schema.Ref] = struct{}{} requestResponseRefs[param.Schema.Ref] = struct{}{}
} }
} }
operationObject.Summary = route.JoinedDoc() operationObject.Summary = strings.ReplaceAll(route.JoinedDoc(), "\"", "")
if len(route.AtDoc.Properties) > 0 { if len(route.AtDoc.Properties) > 0 {
operationObject.Description, _ = strconv.Unquote(route.AtDoc.Properties["description"]) operationObject.Description, _ = strconv.Unquote(route.AtDoc.Properties["description"])
} }
operationObject.Description = strings.ReplaceAll(operationObject.Description, "\"", "")
switch strings.ToUpper(route.Method) { switch strings.ToUpper(route.Method) {
case http.MethodGet: case http.MethodGet:
pathItemObject.Get = operationObject pathItemObject.Get = operationObject