mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
added circular trap, models cannot resolve circular refs
Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user