Skip to content

Commit e8e27ff

Browse files
committed
Fix go-swagger throws error on Windows if application path contains parentheses #145
Signed-off-by: Aleksey Mikhaylov <[email protected]>
1 parent 9b48106 commit e8e27ff

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

schema_loader.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,14 @@ func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error)
168168
normalized := normalizeBase(pth)
169169
debugLog("loading doc from: %s", normalized)
170170

171-
data, fromCache := r.cache.Get(normalized)
171+
unescaped, err := url.PathUnescape(normalized)
172+
if err != nil {
173+
return nil, url.URL{}, false, err
174+
}
175+
176+
u := url.URL{Path: unescaped}
177+
178+
data, fromCache := r.cache.Get(u.RequestURI())
172179
if fromCache {
173180
return data, toFetch, fromCache, nil
174181
}

0 commit comments

Comments
 (0)