mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-10 04:20:24 +00:00
Fixed glitch reported by #219
Context was not being carried through correctly when resolving using `Schema()` and using exploded files. Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
@@ -463,9 +463,12 @@ func (s *Schema) Build(ctx context.Context, root *yaml.Node, idx *index.SpecInde
|
|||||||
s.Reference = new(low.Reference)
|
s.Reference = new(low.Reference)
|
||||||
s.Index = idx
|
s.Index = idx
|
||||||
if h, _, _ := utils.IsNodeRefValue(root); h {
|
if h, _, _ := utils.IsNodeRefValue(root); h {
|
||||||
ref, _, err := low.LocateRefNode(root, idx)
|
ref, _, err, fctx := low.LocateRefNodeWithContext(ctx, root, idx)
|
||||||
if ref != nil {
|
if ref != nil {
|
||||||
root = ref
|
root = ref
|
||||||
|
if fctx != nil {
|
||||||
|
ctx = fctx
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !idx.AllowCircularReferenceResolving() {
|
if !idx.AllowCircularReferenceResolving() {
|
||||||
return fmt.Errorf("build schema failed: %s", err.Error())
|
return fmt.Errorf("build schema failed: %s", err.Error())
|
||||||
|
|||||||
Reference in New Issue
Block a user