mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 20:47:44 +00:00
Fixed issue reported in discord channel
Building out a model, the current position was getting a bit muddled with deeply nested file references. Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
@@ -1221,6 +1221,15 @@ func ExtractSchema(ctx context.Context, root *yaml.Node, idx *index.SpecIndex) (
|
||||
if schNode != nil {
|
||||
h := false
|
||||
if h, _, refLocation = utils.IsNodeRefValue(schNode); h {
|
||||
var specPath string
|
||||
if ctx != nil && ctx.Value(index.CurrentPathKey) != nil {
|
||||
specPath = ctx.Value(index.CurrentPathKey).(string)
|
||||
}
|
||||
if idx.GetSpecAbsolutePath() != specPath && (!strings.HasPrefix(refLocation, "http") &&
|
||||
!strings.HasPrefix(idx.GetSpecAbsolutePath(), "http")) {
|
||||
ctx = context.WithValue(ctx, index.CurrentPathKey, idx.GetSpecAbsolutePath())
|
||||
}
|
||||
|
||||
ref, _, _, nCtx := low.LocateRefNodeWithContext(ctx, schNode, idx)
|
||||
if ref != nil {
|
||||
refNode = schNode
|
||||
|
||||
Reference in New Issue
Block a user