mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 20:47:44 +00:00
expose optional function to resolve remote files
This commit is contained in:
@@ -3,7 +3,10 @@
|
||||
|
||||
package datamodel
|
||||
|
||||
import "net/url"
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// DocumentConfiguration is used to configure the document creation process. It was added in v0.6.0 to allow
|
||||
// for more fine-grained control over controls and new features.
|
||||
@@ -15,6 +18,10 @@ type DocumentConfiguration struct {
|
||||
// Schema must be set to "http/https".
|
||||
BaseURL *url.URL
|
||||
|
||||
// RemoteDocumentGetter is a function that will be used to retrieve remote documents. If not set, the default
|
||||
// remote document getter 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.
|
||||
// It's usually the location of the root specification.
|
||||
BasePath string // set the Base Path for resolving relative references if the spec is exploded.
|
||||
|
||||
Reference in New Issue
Block a user