mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-08 04:20:17 +00:00
@@ -110,18 +110,12 @@ func LocateRefNodeWithContext(ctx context.Context, root *yaml.Node, idx *index.S
|
|||||||
} else {
|
} else {
|
||||||
if specPath != "" {
|
if specPath != "" {
|
||||||
var abs string
|
var abs string
|
||||||
// multi file ref, looking for the root.
|
if explodedRefValue[0] == "" {
|
||||||
if filepath.Base(specPath) == "root.yaml" && explodedRefValue[0] == "" {
|
|
||||||
abs = specPath
|
abs = specPath
|
||||||
} else {
|
} else {
|
||||||
if explodedRefValue[0] == "" {
|
abs, _ = filepath.Abs(filepath.Join(filepath.Dir(specPath), explodedRefValue[0]))
|
||||||
abs = specPath
|
|
||||||
} else {
|
|
||||||
abs, _ = filepath.Abs(filepath.Join(filepath.Dir(specPath), explodedRefValue[0]))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
rv = fmt.Sprintf("%s#%s", abs, explodedRefValue[1])
|
rv = fmt.Sprintf("%s#%s", abs, explodedRefValue[1])
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// check for a config baseURL and use that if it exists.
|
// check for a config baseURL and use that if it exists.
|
||||||
|
|||||||
Reference in New Issue
Block a user