mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
expose optional function to resolve remote files
This commit is contained in:
@@ -4,12 +4,13 @@
|
||||
package index
|
||||
|
||||
import (
|
||||
"golang.org/x/sync/syncmap"
|
||||
"gopkg.in/yaml.v3"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
"golang.org/x/sync/syncmap"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
// Constants used to determine if resolving is local, file based or remote file based.
|
||||
@@ -60,6 +61,10 @@ type SpecIndexConfig struct {
|
||||
// More details on relative references can be found in issue #73: https://github.com/pb33f/libopenapi/issues/73
|
||||
BaseURL *url.URL // set the Base URL for resolving relative references if the spec is exploded.
|
||||
|
||||
// If resolving remotely, the RemoteDocumentGetter will be used to fetch the remote document.
|
||||
// If not set, the default http client will be used.
|
||||
RemoteDocumentGetter func(url string) (*http.Response, error)
|
||||
|
||||
// If resolving locally, the BasePath will be the root from which relative references will be resolved from
|
||||
BasePath string // set the Base Path for resolving relative references if the spec is exploded.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user