Addressed comments from review and fixed bug with schema props

props did not have context, therefore they had no idea where they were or where to resolve from.

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2023-11-02 10:28:29 -04:00
parent 80b2b2d0b5
commit 8bbb022daa
6 changed files with 43 additions and 35 deletions

View File

@@ -109,8 +109,17 @@ func LocateRefNodeWithContext(ctx context.Context, root *yaml.Node, idx *index.S
} else {
if specPath != "" {
abs, _ := filepath.Abs(filepath.Join(filepath.Dir(specPath), explodedRefValue[0]))
var abs string
// multi file ref, looking for the root.
if filepath.Base(specPath) == "root.yaml" && explodedRefValue[0] == "" {
abs = specPath
} else {
if explodedRefValue[0] == "" {
abs = specPath
} else {
abs, _ = filepath.Abs(filepath.Join(filepath.Dir(specPath), explodedRefValue[0]))
}
}
rv = fmt.Sprintf("%s#%s", abs, explodedRefValue[1])
} else {