diff --git a/pkg/profiles/openapi.go b/pkg/profiles/openapi.go index 8b956ff7e..d3a65dbc9 100644 --- a/pkg/profiles/openapi.go +++ b/pkg/profiles/openapi.go @@ -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)