Skip to content

Commit

Permalink
openapi3: fast path drilling into UFO-type refs
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
  • Loading branch information
fenollp committed Nov 25, 2023
1 parent 6986148 commit 4d6e861
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 @@ -317,6 +317,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 4d6e861

Please sign in to comment.