We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de94f28 commit 94ab8c2Copy full SHA for 94ab8c2
pkg/loader/url.go
@@ -135,15 +135,17 @@ func getWithDefaults(req *http.Request) ([]byte, error) {
135
originalPath := req.URL.Path
136
137
// First, try to get the original path as is.
138
- // It might be a raw tool file or an OpenAPI definition.
+ // It might be an OpenAPI definition.
139
resp, err := http.DefaultClient.Do(req)
140
if err != nil {
141
return nil, err
142
}
143
defer resp.Body.Close()
144
145
if resp.StatusCode == http.StatusOK {
146
- return io.ReadAll(resp.Body)
+ if toolBytes, err := io.ReadAll(resp.Body); err == nil && isOpenAPI(toolBytes) != 0 {
147
+ return toolBytes, nil
148
+ }
149
150
151
for i, def := range types.DefaultFiles {
0 commit comments