MCPcopy Create free account
hub / github.com/getkin/kin-openapi / resolvePath

Method resolvePath

openapi3/loader.go:307–319  ·  view source on GitHub ↗
(basePath *url.URL, componentPath *url.URL)

Source from the content-addressed store, hash-verified

305}
306
307func (loader *Loader) resolvePath(basePath *url.URL, componentPath *url.URL) *url.URL {
308 if is_file(componentPath) {
309 // support absolute paths
310 if filepath.IsAbs(componentPath.Path) {
311 return componentPath
312 }
313 if loader.JoinFunc != nil {
314 return loader.JoinFunc(basePath, componentPath)
315 }
316 return defaultJoin(basePath, componentPath)
317 }
318 return componentPath
319}
320
321func (loader *Loader) resolvePathWithRef(ref string, rootPath *url.URL) (*url.URL, error) {
322 parsedURL, err := url.Parse(ref)

Callers 1

resolvePathWithRefMethod · 0.95

Calls 2

is_fileFunction · 0.85
defaultJoinFunction · 0.85

Tested by

no test coverage detected