added circular trap, models cannot resolve circular refs

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2024-01-03 14:13:13 -05:00
parent a16ff8f916
commit ee50403678

View File

@@ -206,6 +206,19 @@ func (sp *SchemaProxy) MarshalYAMLInline() (interface{}, error) {
var s *Schema
var err error
s, err = sp.BuildSchema()
if s != nil && s.GoLow() != nil && s.GoLow().Index != nil {
circ := s.GoLow().Index.GetCircularReferences()
for _, c := range circ {
if sp.IsReference() {
// we cannot proceed.
if sp.GetReference() == c.LoopPoint.Definition {
return sp.GetReferenceNode(), nil
}
}
}
}
if err != nil {
return nil, err
}