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

Function ReadFromFile

openapi3/loader_uri_reader.go:79–84  ·  view source on GitHub ↗

ReadFromFile is a ReadFromURIFunc which reads local file URIs.

(loader *Loader, location *url.URL)

Source from the content-addressed store, hash-verified

77
78// ReadFromFile is a ReadFromURIFunc which reads local file URIs.
79func ReadFromFile(loader *Loader, location *url.URL) ([]byte, error) {
80 if !is_file(location) {
81 return nil, ErrURINotSupported
82 }
83 return os.ReadFile(path.Clean(filepath.FromSlash(location.Path)))
84}
85
86// URIMapCache returns a ReadFromURIFunc that caches the contents read from URI
87// locations in a simple map. This cache implementation is suitable for

Callers 1

Calls 1

is_fileFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…