Fixed logic and test failure

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2023-11-17 16:24:03 -05:00
parent af5cb775aa
commit 745142d9e0
2 changed files with 7 additions and 6 deletions

View File

@@ -1261,8 +1261,8 @@ func ExtractSchema(ctx context.Context, root *yaml.Node, idx *index.SpecIndex) (
ctx = nCtx
idx = fIdx
} else {
v := schNode.Content[1].Value
if schNode.Content[1].Value == "" {
v := root.Content[1].Value
if root.Content[1].Value == "" {
v = "[empty]"
}
return nil, fmt.Errorf(errStr,

View File

@@ -287,10 +287,6 @@ func (i *RemoteFS) Open(remoteURL string) (fs.File, error) {
return r.(*RemoteFile), nil
}
if remoteParsedURL.Scheme == "" {
return nil, nil // not a remote file, nothing wrong with that - just we can't keep looking here partner.
}
// if we're processing, we need to block and wait for the file to be processed
// try path first
if _, ok := i.ProcessingFiles.Load(remoteParsedURL.Path); ok {
@@ -338,6 +334,11 @@ func (i *RemoteFS) Open(remoteURL string) (fs.File, error) {
}
}
if remoteParsedURL.Scheme == "" {
i.ProcessingFiles.Delete(remoteParsedURL.Path)
return nil, nil // not a remote file, nothing wrong with that - just we can't keep looking here partner.
}
i.logger.Debug("loading remote file", "file", remoteURL, "remoteURL", remoteParsedURL.String())
response, clientErr := i.RemoteHandlerFunc(remoteParsedURL.String())