mirror of https://github.com/linkerd/linkerd2.git
Add support for `basePath` in swagger 2.0 files (#2211)
Fixes #2175 Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
This commit is contained in:
parent
79b875a1e8
commit
50fbcc60b5
|
@ -5,6 +5,7 @@ import (
|
|||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"path"
|
||||
"regexp"
|
||||
"sort"
|
||||
|
||||
|
@ -65,8 +66,9 @@ func swaggerToServiceProfile(swagger spec.Swagger, namespace, name, controlPlane
|
|||
sort.Strings(paths)
|
||||
}
|
||||
|
||||
for _, path := range paths {
|
||||
item := swagger.Paths.Paths[path]
|
||||
for _, relPath := range paths {
|
||||
item := swagger.Paths.Paths[relPath]
|
||||
path := path.Join(swagger.BasePath, relPath)
|
||||
pathRegex := pathToRegex(path)
|
||||
if item.Delete != nil {
|
||||
spec := mkRouteSpec(path, pathRegex, http.MethodDelete, item.Delete.Responses)
|
||||
|
|
Loading…
Reference in New Issue