go-openapi / spec

openapi specification object model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Behavior of Ref.GetPointer()

fredbi opened this issue · comments

Hello

While working to improve the validate package, I noticed some loops in that package calling recursively Ref.GetPointer().Get(s.spec.Spec()) where actually (supposedly) dead code.

I assume that GetPointer().Get() expands the full tree of $refs in the first call, so it shouldn't be needed to call it again.

Could you please confirm this behavior in current master and that it is supposed to be a stable assumption about $ref resolution by the spec package?

If confirmed, it would allow to throw out quite a lot of safeguards in the validate package.

Cheers,

Fred

These nested calls to GetPointer() are obsolete code to be replaced by proper param/response expansion methods (ongoing)

I think I may close this now, since obsolete use of GetPointer() in validate in lieu of expand is now closed.