Skip to content

Commit

Permalink
openapi3: fast path drilling into UFO-type refs (#866)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp committed Nov 26, 2023
1 parent 961d6f5 commit a643c4c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions openapi3/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,13 @@ func (loader *Loader) resolveComponent(doc *T, ref string, path *url.URL, resolv
pathPart = unescapeRefString(pathPart)
attempted := false

// Special case of T
// See issue856: a ref to doc => we assume that doc is a T => things live in T.Extensions
if t, ok := cursor.(*T); ok && pathPart == "" {
cursor = t.Extensions
attempted = true
}

// Special case due to multijson
if s, ok := cursor.(*SchemaRef); ok && pathPart == "additionalProperties" {
if ap := s.Value.AdditionalProperties.Has; ap != nil {
Expand Down

0 comments on commit a643c4c

Please sign in to comment.