mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 12:37:48 +00:00
extraction functions coverage bumped back up
Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
@@ -99,9 +99,12 @@ func LocateRefNodeWithContext(ctx context.Context, root *yaml.Node, idx *index.S
|
||||
|
||||
if strings.HasPrefix(specPath, "http") {
|
||||
u, _ := url.Parse(specPath)
|
||||
p := filepath.Dir(u.Path)
|
||||
abs, _ := filepath.Abs(filepath.Join(p, explodedRefValue[0]))
|
||||
u.Path = abs
|
||||
p := ""
|
||||
if u.Path != "" {
|
||||
p = filepath.Dir(u.Path)
|
||||
}
|
||||
u.Path = filepath.Join(p, explodedRefValue[0])
|
||||
u.Fragment = ""
|
||||
rv = fmt.Sprintf("%s#%s", u.String(), explodedRefValue[1])
|
||||
|
||||
} else {
|
||||
@@ -116,9 +119,11 @@ func LocateRefNodeWithContext(ctx context.Context, root *yaml.Node, idx *index.S
|
||||
if idx.GetConfig().BaseURL != nil {
|
||||
|
||||
u := *idx.GetConfig().BaseURL
|
||||
|
||||
abs, _ := filepath.Abs(filepath.Join(u.Path, rv))
|
||||
u.Path = abs
|
||||
p := ""
|
||||
if u.Path != "" {
|
||||
p = filepath.Dir(u.Path)
|
||||
}
|
||||
u.Path = filepath.Join(p, explodedRefValue[0])
|
||||
rv = fmt.Sprintf("%s#%s", u.String(), explodedRefValue[1])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user