-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openapi: Add support for external refs #11076
base: master
Are you sure you want to change the base?
Conversation
645aa72
to
c3c773c
Compare
tpl/openapi/openapi3/openapi3.go
Outdated
return nil, err | ||
} | ||
|
||
return ioutil.ReadAll(file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return ioutil.ReadAll(file) | |
return io.ReadAll(file) |
ioutil
is deprecated. See #10732
tpl/openapi/openapi3/openapi3.go
Outdated
var relativePath string | ||
|
||
if strings.HasPrefix(url.Path, "./") { | ||
relativePath = strings.TrimRightFunc(key, func(r rune) bool { return r != '/' }) + strings.TrimPrefix(url.Path, "./") | ||
} else { | ||
relativePath = url.Path | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var relativePath string | |
if strings.HasPrefix(url.Path, "./") { | |
relativePath = strings.TrimRightFunc(key, func(r rune) bool { return r != '/' }) + strings.TrimPrefix(url.Path, "./") | |
} else { | |
relativePath = url.Path | |
} | |
relativePath := url.Path | |
if strings.HasPrefix(url.Path, "./") { | |
relativePath = strings.TrimRightFunc(key, func(r rune) bool { return r != '/' }) + strings.TrimPrefix(url.Path, "./") | |
} |
if err != nil { | ||
return nil, err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing defer file.Close()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just throwing this out there, but it looks like the contributor added the defer file.Close()
on line 108
Set IsExternalRefsAllowed to true and provide a ReadFromURIFunc. Fixes gohugoio#8067
c3c773c
to
8ee09a6
Compare
Set IsExternalRefsAllowed to true and provide a ReadFromURIFunc.
Fixes #8067