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

Method LoadFromFile

openapi3/loader.go:94–97  ·  view source on GitHub ↗

LoadFromFile loads a spec from a local file path

(location string)

Source from the content-addressed store, hash-verified

92
93// LoadFromFile loads a spec from a local file path
94func (loader *Loader) LoadFromFile(location string) (*T, error) {
95 loader.rootDir = path.Dir(location)
96 return loader.LoadFromURI(&url.URL{Path: filepath.ToSlash(location)})
97}
98
99func (loader *Loader) loadFromURIInternal(location *url.URL) (*T, error) {
100 data, err := loader.readURL(location)

Callers 15

TestIssue220Function · 0.95
TestIssue341Function · 0.95
TestIssue601Function · 0.95
TestIssue499Function · 0.95
TestCrashOnLoadFunction · 0.95
TestIssue344Function · 0.95

Calls 1

LoadFromURIMethod · 0.95

Tested by 15

TestIssue220Function · 0.76
TestIssue341Function · 0.76
TestIssue601Function · 0.76
TestIssue499Function · 0.76
TestCrashOnLoadFunction · 0.76
TestIssue344Function · 0.76