mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Go: Bump github.com/go-openapi/jsonreference from 0.20.2 to 0.20.4 (#7170)
Bumps [github.com/go-openapi/jsonreference](https://github.com/go-openapi/jsonreference) from 0.20.2 to 0.20.4. - [Commits](https://github.com/go-openapi/jsonreference/compare/v0.20.2...v0.20.4) --- updated-dependencies: - dependency-name: github.com/go-openapi/jsonreference dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
6
go.mod
6
go.mod
@@ -18,8 +18,8 @@ require (
|
|||||||
github.com/frapposelli/wwhrd v0.4.0
|
github.com/frapposelli/wwhrd v0.4.0
|
||||||
github.com/fsnotify/fsnotify v1.7.0
|
github.com/fsnotify/fsnotify v1.7.0
|
||||||
github.com/go-git/go-git/v5 v5.11.0
|
github.com/go-git/go-git/v5 v5.11.0
|
||||||
github.com/go-openapi/jsonpointer v0.20.0
|
github.com/go-openapi/jsonpointer v0.20.2
|
||||||
github.com/go-openapi/jsonreference v0.20.2
|
github.com/go-openapi/jsonreference v0.20.4
|
||||||
github.com/go-openapi/spec v0.20.8
|
github.com/go-openapi/spec v0.20.8
|
||||||
github.com/golang/mock v1.6.0
|
github.com/golang/mock v1.6.0
|
||||||
github.com/google/go-cmp v0.6.0
|
github.com/google/go-cmp v0.6.0
|
||||||
@@ -120,7 +120,7 @@ require (
|
|||||||
github.com/go-git/go-billy/v5 v5.5.0 // indirect
|
github.com/go-git/go-billy/v5 v5.5.0 // indirect
|
||||||
github.com/go-logr/logr v1.2.4 // indirect
|
github.com/go-logr/logr v1.2.4 // indirect
|
||||||
github.com/go-logr/zapr v1.2.4 // indirect
|
github.com/go-logr/zapr v1.2.4 // indirect
|
||||||
github.com/go-openapi/swag v0.22.4 // indirect
|
github.com/go-openapi/swag v0.22.6 // indirect
|
||||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
|
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
|
||||||
github.com/gobwas/glob v0.2.3 // indirect
|
github.com/gobwas/glob v0.2.3 // indirect
|
||||||
github.com/godbus/dbus/v5 v5.1.0 // indirect
|
github.com/godbus/dbus/v5 v5.1.0 // indirect
|
||||||
|
|||||||
16
go.sum
generated
16
go.sum
generated
@@ -530,16 +530,15 @@ github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+
|
|||||||
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
|
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
|
||||||
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
||||||
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q=
|
||||||
github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ=
|
github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs=
|
||||||
github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA=
|
|
||||||
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
|
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
|
||||||
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
|
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
|
||||||
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
|
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
|
||||||
github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg=
|
github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg=
|
||||||
github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo=
|
github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo=
|
||||||
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU=
|
||||||
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4=
|
||||||
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
|
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
|
||||||
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
|
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
|
||||||
github.com/go-openapi/spec v0.20.8 h1:ubHmXNY3FCIOinT8RNrrPfGc9t7I1qhPtdOGoG2AxRU=
|
github.com/go-openapi/spec v0.20.8 h1:ubHmXNY3FCIOinT8RNrrPfGc9t7I1qhPtdOGoG2AxRU=
|
||||||
@@ -549,9 +548,8 @@ github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh
|
|||||||
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
|
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
|
||||||
github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
|
github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
|
||||||
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
|
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
|
||||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
github.com/go-openapi/swag v0.22.6 h1:dnqg1XfHXL9aBxSbktBqFR5CxVyVI+7fYWhAf1JOeTw=
|
||||||
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
|
github.com/go-openapi/swag v0.22.6/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0=
|
||||||
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
|
||||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
||||||
@@ -1202,7 +1200,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
|||||||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
|
||||||
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
@@ -1214,7 +1211,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
|||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
|
||||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||||
|
|||||||
61
vendor/github.com/go-openapi/jsonpointer/.golangci.yml
generated
vendored
Normal file
61
vendor/github.com/go-openapi/jsonpointer/.golangci.yml
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
linters-settings:
|
||||||
|
govet:
|
||||||
|
check-shadowing: true
|
||||||
|
golint:
|
||||||
|
min-confidence: 0
|
||||||
|
gocyclo:
|
||||||
|
min-complexity: 45
|
||||||
|
maligned:
|
||||||
|
suggest-new: true
|
||||||
|
dupl:
|
||||||
|
threshold: 200
|
||||||
|
goconst:
|
||||||
|
min-len: 2
|
||||||
|
min-occurrences: 3
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable-all: true
|
||||||
|
disable:
|
||||||
|
- maligned
|
||||||
|
- unparam
|
||||||
|
- lll
|
||||||
|
- gochecknoinits
|
||||||
|
- gochecknoglobals
|
||||||
|
- funlen
|
||||||
|
- godox
|
||||||
|
- gocognit
|
||||||
|
- whitespace
|
||||||
|
- wsl
|
||||||
|
- wrapcheck
|
||||||
|
- testpackage
|
||||||
|
- nlreturn
|
||||||
|
- gomnd
|
||||||
|
- exhaustivestruct
|
||||||
|
- goerr113
|
||||||
|
- errorlint
|
||||||
|
- nestif
|
||||||
|
- godot
|
||||||
|
- gofumpt
|
||||||
|
- paralleltest
|
||||||
|
- tparallel
|
||||||
|
- thelper
|
||||||
|
- ifshort
|
||||||
|
- exhaustruct
|
||||||
|
- varnamelen
|
||||||
|
- gci
|
||||||
|
- depguard
|
||||||
|
- errchkjson
|
||||||
|
- inamedparam
|
||||||
|
- nonamedreturns
|
||||||
|
- musttag
|
||||||
|
- ireturn
|
||||||
|
- forcetypeassert
|
||||||
|
- cyclop
|
||||||
|
# deprecated linters
|
||||||
|
- deadcode
|
||||||
|
- interfacer
|
||||||
|
- scopelint
|
||||||
|
- varcheck
|
||||||
|
- structcheck
|
||||||
|
- golint
|
||||||
|
- nosnakecase
|
||||||
8
vendor/github.com/go-openapi/jsonpointer/README.md
generated
vendored
8
vendor/github.com/go-openapi/jsonpointer/README.md
generated
vendored
@@ -1,6 +1,10 @@
|
|||||||
# gojsonpointer [](https://travis-ci.org/go-openapi/jsonpointer) [](https://codecov.io/gh/go-openapi/jsonpointer) [](https://slackin.goswagger.io)
|
# gojsonpointer [](https://github.com/go-openapi/jsonpointer/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/jsonpointer)
|
||||||
|
|
||||||
|
[](https://slackin.goswagger.io)
|
||||||
|
[](https://raw.githubusercontent.com/go-openapi/jsonpointer/master/LICENSE)
|
||||||
|
[](https://pkg.go.dev/github.com/go-openapi/jsonpointer)
|
||||||
|
[](https://goreportcard.com/report/github.com/go-openapi/jsonpointer)
|
||||||
|
|
||||||
[](https://raw.githubusercontent.com/go-openapi/jsonpointer/master/LICENSE) [](http://godoc.org/github.com/go-openapi/jsonpointer)
|
|
||||||
An implementation of JSON Pointer - Go language
|
An implementation of JSON Pointer - Go language
|
||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
|||||||
68
vendor/github.com/go-openapi/jsonpointer/pointer.go
generated
vendored
68
vendor/github.com/go-openapi/jsonpointer/pointer.go
generated
vendored
@@ -110,19 +110,39 @@ func SetForToken(document any, decodedToken string, value any) (any, error) {
|
|||||||
return document, setSingleImpl(document, value, decodedToken, swag.DefaultJSONNameProvider)
|
return document, setSingleImpl(document, value, decodedToken, swag.DefaultJSONNameProvider)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isNil(input any) bool {
|
||||||
|
if input == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
kind := reflect.TypeOf(input).Kind()
|
||||||
|
switch kind { //nolint:exhaustive
|
||||||
|
case reflect.Ptr, reflect.Map, reflect.Slice, reflect.Chan:
|
||||||
|
return reflect.ValueOf(input).IsNil()
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvider) (any, reflect.Kind, error) {
|
func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvider) (any, reflect.Kind, error) {
|
||||||
rValue := reflect.Indirect(reflect.ValueOf(node))
|
rValue := reflect.Indirect(reflect.ValueOf(node))
|
||||||
kind := rValue.Kind()
|
kind := rValue.Kind()
|
||||||
|
if isNil(node) {
|
||||||
|
return nil, kind, fmt.Errorf("nil value has not field %q", decodedToken)
|
||||||
|
}
|
||||||
|
|
||||||
if rValue.Type().Implements(jsonPointableType) {
|
switch typed := node.(type) {
|
||||||
r, err := node.(JSONPointable).JSONLookup(decodedToken)
|
case JSONPointable:
|
||||||
|
r, err := typed.JSONLookup(decodedToken)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, kind, err
|
return nil, kind, err
|
||||||
}
|
}
|
||||||
return r, kind, nil
|
return r, kind, nil
|
||||||
|
case *any: // case of a pointer to interface, that is not resolved by reflect.Indirect
|
||||||
|
return getSingleImpl(*typed, decodedToken, nameProvider)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch kind {
|
switch kind { //nolint:exhaustive
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
|
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -170,7 +190,7 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider *swag.NameP
|
|||||||
return node.(JSONSetable).JSONSet(decodedToken, data)
|
return node.(JSONSetable).JSONSet(decodedToken, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch rValue.Kind() {
|
switch rValue.Kind() { //nolint:exhaustive
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
|
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -231,8 +251,7 @@ func (p *Pointer) get(node any, nameProvider *swag.NameProvider) (any, reflect.K
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, knd, err
|
return nil, knd, err
|
||||||
}
|
}
|
||||||
node, kind = r, knd
|
node = r
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rValue := reflect.ValueOf(node)
|
rValue := reflect.ValueOf(node)
|
||||||
@@ -284,7 +303,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
switch kind {
|
switch kind { //nolint:exhaustive
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
|
nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken)
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -405,11 +424,11 @@ func offsetSingleObject(dec *json.Decoder, decodedToken string) (int64, error) {
|
|||||||
case json.Delim:
|
case json.Delim:
|
||||||
switch tk {
|
switch tk {
|
||||||
case '{':
|
case '{':
|
||||||
if err := drainSingle(dec); err != nil {
|
if err = drainSingle(dec); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
case '[':
|
case '[':
|
||||||
if err := drainSingle(dec); err != nil {
|
if err = drainSingle(dec); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -435,20 +454,21 @@ func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
switch tk := tk.(type) {
|
|
||||||
case json.Delim:
|
if delim, isDelim := tk.(json.Delim); isDelim {
|
||||||
switch tk {
|
switch delim {
|
||||||
case '{':
|
case '{':
|
||||||
if err := drainSingle(dec); err != nil {
|
if err = drainSingle(dec); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
case '[':
|
case '[':
|
||||||
if err := drainSingle(dec); err != nil {
|
if err = drainSingle(dec); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !dec.More() {
|
if !dec.More() {
|
||||||
return 0, fmt.Errorf("token reference %q not found", decodedToken)
|
return 0, fmt.Errorf("token reference %q not found", decodedToken)
|
||||||
}
|
}
|
||||||
@@ -456,27 +476,27 @@ func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// drainSingle drains a single level of object or array.
|
// drainSingle drains a single level of object or array.
|
||||||
// The decoder has to guarantee the begining delim (i.e. '{' or '[') has been consumed.
|
// The decoder has to guarantee the beginning delim (i.e. '{' or '[') has been consumed.
|
||||||
func drainSingle(dec *json.Decoder) error {
|
func drainSingle(dec *json.Decoder) error {
|
||||||
for dec.More() {
|
for dec.More() {
|
||||||
tk, err := dec.Token()
|
tk, err := dec.Token()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
switch tk := tk.(type) {
|
if delim, isDelim := tk.(json.Delim); isDelim {
|
||||||
case json.Delim:
|
switch delim {
|
||||||
switch tk {
|
|
||||||
case '{':
|
case '{':
|
||||||
if err := drainSingle(dec); err != nil {
|
if err = drainSingle(dec); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case '[':
|
case '[':
|
||||||
if err := drainSingle(dec); err != nil {
|
if err = drainSingle(dec); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Consumes the ending delim
|
// Consumes the ending delim
|
||||||
if _, err := dec.Token(); err != nil {
|
if _, err := dec.Token(); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -498,14 +518,14 @@ const (
|
|||||||
|
|
||||||
// Unescape unescapes a json pointer reference token string to the original representation
|
// Unescape unescapes a json pointer reference token string to the original representation
|
||||||
func Unescape(token string) string {
|
func Unescape(token string) string {
|
||||||
step1 := strings.Replace(token, encRefTok1, decRefTok1, -1)
|
step1 := strings.ReplaceAll(token, encRefTok1, decRefTok1)
|
||||||
step2 := strings.Replace(step1, encRefTok0, decRefTok0, -1)
|
step2 := strings.ReplaceAll(step1, encRefTok0, decRefTok0)
|
||||||
return step2
|
return step2
|
||||||
}
|
}
|
||||||
|
|
||||||
// Escape escapes a pointer reference token string
|
// Escape escapes a pointer reference token string
|
||||||
func Escape(token string) string {
|
func Escape(token string) string {
|
||||||
step1 := strings.Replace(token, decRefTok0, encRefTok0, -1)
|
step1 := strings.ReplaceAll(token, decRefTok0, encRefTok0)
|
||||||
step2 := strings.Replace(step1, decRefTok1, encRefTok1, -1)
|
step2 := strings.ReplaceAll(step1, decRefTok1, encRefTok1)
|
||||||
return step2
|
return step2
|
||||||
}
|
}
|
||||||
|
|||||||
59
vendor/github.com/go-openapi/jsonreference/.golangci.yml
generated
vendored
59
vendor/github.com/go-openapi/jsonreference/.golangci.yml
generated
vendored
@@ -1,50 +1,61 @@
|
|||||||
linters-settings:
|
linters-settings:
|
||||||
govet:
|
govet:
|
||||||
check-shadowing: true
|
check-shadowing: true
|
||||||
|
golint:
|
||||||
|
min-confidence: 0
|
||||||
gocyclo:
|
gocyclo:
|
||||||
min-complexity: 30
|
min-complexity: 45
|
||||||
maligned:
|
maligned:
|
||||||
suggest-new: true
|
suggest-new: true
|
||||||
dupl:
|
dupl:
|
||||||
threshold: 100
|
threshold: 200
|
||||||
goconst:
|
goconst:
|
||||||
min-len: 2
|
min-len: 2
|
||||||
min-occurrences: 4
|
min-occurrences: 3
|
||||||
paralleltest:
|
|
||||||
ignore-missing: true
|
|
||||||
linters:
|
linters:
|
||||||
enable-all: true
|
enable-all: true
|
||||||
disable:
|
disable:
|
||||||
- maligned
|
- maligned
|
||||||
|
- unparam
|
||||||
- lll
|
- lll
|
||||||
|
- gochecknoinits
|
||||||
- gochecknoglobals
|
- gochecknoglobals
|
||||||
|
- funlen
|
||||||
- godox
|
- godox
|
||||||
- gocognit
|
- gocognit
|
||||||
- whitespace
|
- whitespace
|
||||||
- wsl
|
- wsl
|
||||||
- funlen
|
|
||||||
- gochecknoglobals
|
|
||||||
- gochecknoinits
|
|
||||||
- scopelint
|
|
||||||
- wrapcheck
|
- wrapcheck
|
||||||
- exhaustivestruct
|
|
||||||
- exhaustive
|
|
||||||
- nlreturn
|
|
||||||
- testpackage
|
- testpackage
|
||||||
- gci
|
- nlreturn
|
||||||
- gofumpt
|
|
||||||
- goerr113
|
|
||||||
- gomnd
|
- gomnd
|
||||||
- tparallel
|
- exhaustivestruct
|
||||||
|
- goerr113
|
||||||
|
- errorlint
|
||||||
- nestif
|
- nestif
|
||||||
- godot
|
- godot
|
||||||
- errorlint
|
- gofumpt
|
||||||
- varcheck
|
- paralleltest
|
||||||
- interfacer
|
- tparallel
|
||||||
- deadcode
|
- thelper
|
||||||
- golint
|
|
||||||
- ifshort
|
- ifshort
|
||||||
- structcheck
|
|
||||||
- nosnakecase
|
|
||||||
- varnamelen
|
|
||||||
- exhaustruct
|
- exhaustruct
|
||||||
|
- varnamelen
|
||||||
|
- gci
|
||||||
|
- depguard
|
||||||
|
- errchkjson
|
||||||
|
- inamedparam
|
||||||
|
- nonamedreturns
|
||||||
|
- musttag
|
||||||
|
- ireturn
|
||||||
|
- forcetypeassert
|
||||||
|
- cyclop
|
||||||
|
# deprecated linters
|
||||||
|
- deadcode
|
||||||
|
- interfacer
|
||||||
|
- scopelint
|
||||||
|
- varcheck
|
||||||
|
- structcheck
|
||||||
|
- golint
|
||||||
|
- nosnakecase
|
||||||
|
|||||||
14
vendor/github.com/go-openapi/jsonreference/README.md
generated
vendored
14
vendor/github.com/go-openapi/jsonreference/README.md
generated
vendored
@@ -1,15 +1,19 @@
|
|||||||
# gojsonreference [](https://travis-ci.org/go-openapi/jsonreference) [](https://codecov.io/gh/go-openapi/jsonreference) [](https://slackin.goswagger.io)
|
# gojsonreference [](https://github.com/go-openapi/jsonreference/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/jsonreference)
|
||||||
|
|
||||||
|
[](https://slackin.goswagger.io)
|
||||||
|
[](https://raw.githubusercontent.com/go-openapi/jsonreference/master/LICENSE)
|
||||||
|
[](https://pkg.go.dev/github.com/go-openapi/jsonreference)
|
||||||
|
[](https://goreportcard.com/report/github.com/go-openapi/jsonreference)
|
||||||
|
|
||||||
[](https://raw.githubusercontent.com/go-openapi/jsonreference/master/LICENSE) [](http://godoc.org/github.com/go-openapi/jsonreference)
|
|
||||||
An implementation of JSON Reference - Go language
|
An implementation of JSON Reference - Go language
|
||||||
|
|
||||||
## Status
|
## Status
|
||||||
Feature complete. Stable API
|
Feature complete. Stable API
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
https://github.com/go-openapi/jsonpointer
|
* https://github.com/go-openapi/jsonpointer
|
||||||
|
|
||||||
## References
|
## References
|
||||||
http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07
|
|
||||||
|
|
||||||
http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03
|
* http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07
|
||||||
|
* http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03
|
||||||
|
|||||||
1
vendor/github.com/go-openapi/swag/.gitignore
generated
vendored
1
vendor/github.com/go-openapi/swag/.gitignore
generated
vendored
@@ -2,3 +2,4 @@ secrets.yml
|
|||||||
vendor
|
vendor
|
||||||
Godeps
|
Godeps
|
||||||
.idea
|
.idea
|
||||||
|
*.out
|
||||||
|
|||||||
54
vendor/github.com/go-openapi/swag/.golangci.yml
generated
vendored
54
vendor/github.com/go-openapi/swag/.golangci.yml
generated
vendored
@@ -4,14 +4,14 @@ linters-settings:
|
|||||||
golint:
|
golint:
|
||||||
min-confidence: 0
|
min-confidence: 0
|
||||||
gocyclo:
|
gocyclo:
|
||||||
min-complexity: 25
|
min-complexity: 45
|
||||||
maligned:
|
maligned:
|
||||||
suggest-new: true
|
suggest-new: true
|
||||||
dupl:
|
dupl:
|
||||||
threshold: 100
|
threshold: 200
|
||||||
goconst:
|
goconst:
|
||||||
min-len: 3
|
min-len: 3
|
||||||
min-occurrences: 2
|
min-occurrences: 3
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
enable-all: true
|
enable-all: true
|
||||||
@@ -20,35 +20,41 @@ linters:
|
|||||||
- lll
|
- lll
|
||||||
- gochecknoinits
|
- gochecknoinits
|
||||||
- gochecknoglobals
|
- gochecknoglobals
|
||||||
- nlreturn
|
- funlen
|
||||||
- testpackage
|
- godox
|
||||||
|
- gocognit
|
||||||
|
- whitespace
|
||||||
|
- wsl
|
||||||
- wrapcheck
|
- wrapcheck
|
||||||
|
- testpackage
|
||||||
|
- nlreturn
|
||||||
- gomnd
|
- gomnd
|
||||||
- exhaustive
|
|
||||||
- exhaustivestruct
|
- exhaustivestruct
|
||||||
- goerr113
|
- goerr113
|
||||||
- wsl
|
- errorlint
|
||||||
- whitespace
|
|
||||||
- gofumpt
|
|
||||||
- godot
|
|
||||||
- nestif
|
- nestif
|
||||||
- godox
|
- godot
|
||||||
- funlen
|
- gofumpt
|
||||||
- gci
|
|
||||||
- gocognit
|
|
||||||
- paralleltest
|
- paralleltest
|
||||||
|
- tparallel
|
||||||
- thelper
|
- thelper
|
||||||
- ifshort
|
- ifshort
|
||||||
- gomoddirectives
|
|
||||||
- cyclop
|
|
||||||
- forcetypeassert
|
|
||||||
- ireturn
|
|
||||||
- tagliatelle
|
|
||||||
- varnamelen
|
|
||||||
- goimports
|
|
||||||
- tenv
|
|
||||||
- golint
|
|
||||||
- exhaustruct
|
- exhaustruct
|
||||||
- nilnil
|
- varnamelen
|
||||||
|
- gci
|
||||||
|
- depguard
|
||||||
|
- errchkjson
|
||||||
|
- inamedparam
|
||||||
- nonamedreturns
|
- nonamedreturns
|
||||||
|
- musttag
|
||||||
|
- ireturn
|
||||||
|
- forcetypeassert
|
||||||
|
- cyclop
|
||||||
|
# deprecated linters
|
||||||
|
- deadcode
|
||||||
|
- interfacer
|
||||||
|
- scopelint
|
||||||
|
- varcheck
|
||||||
|
- structcheck
|
||||||
|
- golint
|
||||||
- nosnakecase
|
- nosnakecase
|
||||||
|
|||||||
8
vendor/github.com/go-openapi/swag/README.md
generated
vendored
8
vendor/github.com/go-openapi/swag/README.md
generated
vendored
@@ -1,7 +1,8 @@
|
|||||||
# Swag [](https://travis-ci.org/go-openapi/swag) [](https://codecov.io/gh/go-openapi/swag) [](https://slackin.goswagger.io)
|
# Swag [](https://github.com/go-openapi/swag/actions?query=workflow%3A"go+test") [](https://codecov.io/gh/go-openapi/swag)
|
||||||
|
|
||||||
|
[](https://slackin.goswagger.io)
|
||||||
[](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE)
|
[](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE)
|
||||||
[](http://godoc.org/github.com/go-openapi/swag)
|
[](https://pkg.go.dev/github.com/go-openapi/swag)
|
||||||
[](https://goreportcard.com/report/github.com/go-openapi/swag)
|
[](https://goreportcard.com/report/github.com/go-openapi/swag)
|
||||||
|
|
||||||
Contains a bunch of helper functions for go-openapi and go-swagger projects.
|
Contains a bunch of helper functions for go-openapi and go-swagger projects.
|
||||||
@@ -18,4 +19,5 @@ You may also use it standalone for your projects.
|
|||||||
|
|
||||||
This repo has only few dependencies outside of the standard library:
|
This repo has only few dependencies outside of the standard library:
|
||||||
|
|
||||||
* YAML utilities depend on gopkg.in/yaml.v2
|
* YAML utilities depend on `gopkg.in/yaml.v3`
|
||||||
|
* `github.com/mailru/easyjson v0.7.7`
|
||||||
|
|||||||
@@ -12,9 +12,6 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
//go:build go1.9
|
|
||||||
// +build go1.9
|
|
||||||
|
|
||||||
package swag
|
package swag
|
||||||
|
|
||||||
import (
|
import (
|
||||||
105
vendor/github.com/go-openapi/swag/loading.go
generated
vendored
105
vendor/github.com/go-openapi/swag/loading.go
generated
vendored
@@ -21,6 +21,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -40,43 +41,97 @@ var LoadHTTPBasicAuthPassword = ""
|
|||||||
var LoadHTTPCustomHeaders = map[string]string{}
|
var LoadHTTPCustomHeaders = map[string]string{}
|
||||||
|
|
||||||
// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in
|
// LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in
|
||||||
func LoadFromFileOrHTTP(path string) ([]byte, error) {
|
func LoadFromFileOrHTTP(pth string) ([]byte, error) {
|
||||||
return LoadStrategy(path, os.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(path)
|
return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(pth)
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in
|
// LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in
|
||||||
// timeout arg allows for per request overriding of the request timeout
|
// timeout arg allows for per request overriding of the request timeout
|
||||||
func LoadFromFileOrHTTPWithTimeout(path string, timeout time.Duration) ([]byte, error) {
|
func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration) ([]byte, error) {
|
||||||
return LoadStrategy(path, os.ReadFile, loadHTTPBytes(timeout))(path)
|
return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(timeout))(pth)
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadStrategy returns a loader function for a given path or uri
|
// LoadStrategy returns a loader function for a given path or URI.
|
||||||
func LoadStrategy(path string, local, remote func(string) ([]byte, error)) func(string) ([]byte, error) {
|
//
|
||||||
if strings.HasPrefix(path, "http") {
|
// The load strategy returns the remote load for any path starting with `http`.
|
||||||
|
// So this works for any URI with a scheme `http` or `https`.
|
||||||
|
//
|
||||||
|
// The fallback strategy is to call the local loader.
|
||||||
|
//
|
||||||
|
// The local loader takes a local file system path (absolute or relative) as argument,
|
||||||
|
// or alternatively a `file://...` URI, **without host** (see also below for windows).
|
||||||
|
//
|
||||||
|
// There are a few liberalities, initially intended to be tolerant regarding the URI syntax,
|
||||||
|
// especially on windows.
|
||||||
|
//
|
||||||
|
// Before the local loader is called, the given path is transformed:
|
||||||
|
// - percent-encoded characters are unescaped
|
||||||
|
// - simple paths (e.g. `./folder/file`) are passed as-is
|
||||||
|
// - on windows, occurrences of `/` are replaced by `\`, so providing a relative path such a `folder/file` works too.
|
||||||
|
//
|
||||||
|
// For paths provided as URIs with the "file" scheme, please note that:
|
||||||
|
// - `file://` is simply stripped.
|
||||||
|
// This means that the host part of the URI is not parsed at all.
|
||||||
|
// For example, `file:///folder/file" becomes "/folder/file`,
|
||||||
|
// but `file://localhost/folder/file` becomes `localhost/folder/file` on unix systems.
|
||||||
|
// Similarly, `file://./folder/file` yields `./folder/file`.
|
||||||
|
// - on windows, `file://...` can take a host so as to specify an UNC share location.
|
||||||
|
//
|
||||||
|
// Reminder about windows-specifics:
|
||||||
|
// - `file://host/folder/file` becomes an UNC path like `\\host\folder\file` (no port specification is supported)
|
||||||
|
// - `file:///c:/folder/file` becomes `C:\folder\file`
|
||||||
|
// - `file://c:/folder/file` is tolerated (without leading `/`) and becomes `c:\folder\file`
|
||||||
|
func LoadStrategy(pth string, local, remote func(string) ([]byte, error)) func(string) ([]byte, error) {
|
||||||
|
if strings.HasPrefix(pth, "http") {
|
||||||
return remote
|
return remote
|
||||||
}
|
}
|
||||||
return func(pth string) ([]byte, error) {
|
|
||||||
upth, err := pathUnescape(pth)
|
return func(p string) ([]byte, error) {
|
||||||
|
upth, err := url.PathUnescape(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(pth, `file://`) {
|
if !strings.HasPrefix(p, `file://`) {
|
||||||
if runtime.GOOS == "windows" {
|
// regular file path provided: just normalize slashes
|
||||||
// support for canonical file URIs on windows.
|
return local(filepath.FromSlash(upth))
|
||||||
// Zero tolerance here for dodgy URIs.
|
}
|
||||||
u, _ := url.Parse(upth)
|
|
||||||
if u.Host != "" {
|
if runtime.GOOS != "windows" {
|
||||||
// assume UNC name (volume share)
|
// crude processing: this leaves full URIs with a host with a (mostly) unexpected result
|
||||||
// file://host/share/folder\... ==> \\host\share\path\folder
|
upth = strings.TrimPrefix(upth, `file://`)
|
||||||
// NOTE: UNC port not yet supported
|
|
||||||
upth = strings.Join([]string{`\`, u.Host, u.Path}, `\`)
|
return local(filepath.FromSlash(upth))
|
||||||
} else {
|
}
|
||||||
// file:///c:/folder/... ==> just remove the leading slash
|
|
||||||
upth = strings.TrimPrefix(upth, `file:///`)
|
// windows-only pre-processing of file://... URIs
|
||||||
}
|
|
||||||
} else {
|
// support for canonical file URIs on windows.
|
||||||
upth = strings.TrimPrefix(upth, `file://`)
|
u, err := url.Parse(filepath.ToSlash(upth))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if u.Host != "" {
|
||||||
|
// assume UNC name (volume share)
|
||||||
|
// NOTE: UNC port not yet supported
|
||||||
|
|
||||||
|
// when the "host" segment is a drive letter:
|
||||||
|
// file://C:/folder/... => C:\folder
|
||||||
|
upth = path.Clean(strings.Join([]string{u.Host, u.Path}, `/`))
|
||||||
|
if !strings.HasSuffix(u.Host, ":") && u.Host[0] != '.' {
|
||||||
|
// tolerance: if we have a leading dot, this can't be a host
|
||||||
|
// file://host/share/folder\... ==> \\host\share\path\folder
|
||||||
|
upth = "//" + upth
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// no host, let's figure out if this is a drive letter
|
||||||
|
upth = strings.TrimPrefix(upth, `file://`)
|
||||||
|
first, _, _ := strings.Cut(strings.TrimPrefix(u.Path, "/"), "/")
|
||||||
|
if strings.HasSuffix(first, ":") {
|
||||||
|
// drive letter in the first segment:
|
||||||
|
// file:///c:/folder/... ==> strip the leading slash
|
||||||
|
upth = strings.TrimPrefix(upth, `/`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
24
vendor/github.com/go-openapi/swag/post_go18.go
generated
vendored
24
vendor/github.com/go-openapi/swag/post_go18.go
generated
vendored
@@ -1,24 +0,0 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
//go:build go1.8
|
|
||||||
// +build go1.8
|
|
||||||
|
|
||||||
package swag
|
|
||||||
|
|
||||||
import "net/url"
|
|
||||||
|
|
||||||
func pathUnescape(path string) (string, error) {
|
|
||||||
return url.PathUnescape(path)
|
|
||||||
}
|
|
||||||
24
vendor/github.com/go-openapi/swag/pre_go18.go
generated
vendored
24
vendor/github.com/go-openapi/swag/pre_go18.go
generated
vendored
@@ -1,24 +0,0 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
//go:build !go1.8
|
|
||||||
// +build !go1.8
|
|
||||||
|
|
||||||
package swag
|
|
||||||
|
|
||||||
import "net/url"
|
|
||||||
|
|
||||||
func pathUnescape(path string) (string, error) {
|
|
||||||
return url.QueryUnescape(path)
|
|
||||||
}
|
|
||||||
70
vendor/github.com/go-openapi/swag/pre_go19.go
generated
vendored
70
vendor/github.com/go-openapi/swag/pre_go19.go
generated
vendored
@@ -1,70 +0,0 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
//go:build !go1.9
|
|
||||||
// +build !go1.9
|
|
||||||
|
|
||||||
package swag
|
|
||||||
|
|
||||||
import (
|
|
||||||
"sort"
|
|
||||||
"sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
// indexOfInitialisms is a thread-safe implementation of the sorted index of initialisms.
|
|
||||||
// Before go1.9, this may be implemented with a mutex on the map.
|
|
||||||
type indexOfInitialisms struct {
|
|
||||||
getMutex *sync.Mutex
|
|
||||||
index map[string]bool
|
|
||||||
}
|
|
||||||
|
|
||||||
func newIndexOfInitialisms() *indexOfInitialisms {
|
|
||||||
return &indexOfInitialisms{
|
|
||||||
getMutex: new(sync.Mutex),
|
|
||||||
index: make(map[string]bool, 50),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *indexOfInitialisms) load(initial map[string]bool) *indexOfInitialisms {
|
|
||||||
m.getMutex.Lock()
|
|
||||||
defer m.getMutex.Unlock()
|
|
||||||
for k, v := range initial {
|
|
||||||
m.index[k] = v
|
|
||||||
}
|
|
||||||
return m
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *indexOfInitialisms) isInitialism(key string) bool {
|
|
||||||
m.getMutex.Lock()
|
|
||||||
defer m.getMutex.Unlock()
|
|
||||||
_, ok := m.index[key]
|
|
||||||
return ok
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *indexOfInitialisms) add(key string) *indexOfInitialisms {
|
|
||||||
m.getMutex.Lock()
|
|
||||||
defer m.getMutex.Unlock()
|
|
||||||
m.index[key] = true
|
|
||||||
return m
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *indexOfInitialisms) sorted() (result []string) {
|
|
||||||
m.getMutex.Lock()
|
|
||||||
defer m.getMutex.Unlock()
|
|
||||||
for k := range m.index {
|
|
||||||
result = append(result, k)
|
|
||||||
}
|
|
||||||
sort.Sort(sort.Reverse(byInitialism(result)))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
4
vendor/github.com/go-openapi/swag/util.go
generated
vendored
4
vendor/github.com/go-openapi/swag/util.go
generated
vendored
@@ -343,7 +343,7 @@ type zeroable interface {
|
|||||||
func IsZero(data interface{}) bool {
|
func IsZero(data interface{}) bool {
|
||||||
v := reflect.ValueOf(data)
|
v := reflect.ValueOf(data)
|
||||||
// check for nil data
|
// check for nil data
|
||||||
switch v.Kind() {
|
switch v.Kind() { //nolint:exhaustive
|
||||||
case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
|
case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
|
||||||
if v.IsNil() {
|
if v.IsNil() {
|
||||||
return true
|
return true
|
||||||
@@ -356,7 +356,7 @@ func IsZero(data interface{}) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// continue with slightly more complex reflection
|
// continue with slightly more complex reflection
|
||||||
switch v.Kind() {
|
switch v.Kind() { //nolint:exhaustive
|
||||||
case reflect.String:
|
case reflect.String:
|
||||||
return v.Len() == 0
|
return v.Len() == 0
|
||||||
case reflect.Bool:
|
case reflect.Bool:
|
||||||
|
|||||||
36
vendor/github.com/go-openapi/swag/yaml.go
generated
vendored
36
vendor/github.com/go-openapi/swag/yaml.go
generated
vendored
@@ -18,6 +18,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"reflect"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
@@ -147,7 +149,7 @@ func yamlScalar(node *yaml.Node) (interface{}, error) {
|
|||||||
case yamlTimestamp:
|
case yamlTimestamp:
|
||||||
return node.Value, nil
|
return node.Value, nil
|
||||||
case yamlNull:
|
case yamlNull:
|
||||||
return nil, nil
|
return nil, nil //nolint:nilnil
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("YAML tag %q is not supported", node.LongTag())
|
return nil, fmt.Errorf("YAML tag %q is not supported", node.LongTag())
|
||||||
}
|
}
|
||||||
@@ -245,7 +247,27 @@ func (s JSONMapSlice) MarshalYAML() (interface{}, error) {
|
|||||||
return yaml.Marshal(&n)
|
return yaml.Marshal(&n)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isNil(input interface{}) bool {
|
||||||
|
if input == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
kind := reflect.TypeOf(input).Kind()
|
||||||
|
switch kind { //nolint:exhaustive
|
||||||
|
case reflect.Ptr, reflect.Map, reflect.Slice, reflect.Chan:
|
||||||
|
return reflect.ValueOf(input).IsNil()
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func json2yaml(item interface{}) (*yaml.Node, error) {
|
func json2yaml(item interface{}) (*yaml.Node, error) {
|
||||||
|
if isNil(item) {
|
||||||
|
return &yaml.Node{
|
||||||
|
Kind: yaml.ScalarNode,
|
||||||
|
Value: "null",
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
switch val := item.(type) {
|
switch val := item.(type) {
|
||||||
case JSONMapSlice:
|
case JSONMapSlice:
|
||||||
var n yaml.Node
|
var n yaml.Node
|
||||||
@@ -265,7 +287,14 @@ func json2yaml(item interface{}) (*yaml.Node, error) {
|
|||||||
case map[string]interface{}:
|
case map[string]interface{}:
|
||||||
var n yaml.Node
|
var n yaml.Node
|
||||||
n.Kind = yaml.MappingNode
|
n.Kind = yaml.MappingNode
|
||||||
for k, v := range val {
|
keys := make([]string, 0, len(val))
|
||||||
|
for k := range val {
|
||||||
|
keys = append(keys, k)
|
||||||
|
}
|
||||||
|
sort.Strings(keys)
|
||||||
|
|
||||||
|
for _, k := range keys {
|
||||||
|
v := val[k]
|
||||||
childNode, err := json2yaml(v)
|
childNode, err := json2yaml(v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -318,8 +347,9 @@ func json2yaml(item interface{}) (*yaml.Node, error) {
|
|||||||
Tag: yamlBoolScalar,
|
Tag: yamlBoolScalar,
|
||||||
Value: strconv.FormatBool(val),
|
Value: strconv.FormatBool(val),
|
||||||
}, nil
|
}, nil
|
||||||
|
default:
|
||||||
|
return nil, fmt.Errorf("unhandled type: %T", val)
|
||||||
}
|
}
|
||||||
return nil, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// JSONMapItem represents the value of a key in a JSON object held by JSONMapSlice
|
// JSONMapItem represents the value of a key in a JSON object held by JSONMapSlice
|
||||||
|
|||||||
12
vendor/modules.txt
generated
vendored
12
vendor/modules.txt
generated
vendored
@@ -370,18 +370,18 @@ github.com/go-logr/logr/funcr
|
|||||||
# github.com/go-logr/zapr v1.2.4
|
# github.com/go-logr/zapr v1.2.4
|
||||||
## explicit; go 1.16
|
## explicit; go 1.16
|
||||||
github.com/go-logr/zapr
|
github.com/go-logr/zapr
|
||||||
# github.com/go-openapi/jsonpointer v0.20.0
|
# github.com/go-openapi/jsonpointer v0.20.2
|
||||||
## explicit; go 1.18
|
## explicit; go 1.19
|
||||||
github.com/go-openapi/jsonpointer
|
github.com/go-openapi/jsonpointer
|
||||||
# github.com/go-openapi/jsonreference v0.20.2
|
# github.com/go-openapi/jsonreference v0.20.4
|
||||||
## explicit; go 1.13
|
## explicit; go 1.19
|
||||||
github.com/go-openapi/jsonreference
|
github.com/go-openapi/jsonreference
|
||||||
github.com/go-openapi/jsonreference/internal
|
github.com/go-openapi/jsonreference/internal
|
||||||
# github.com/go-openapi/spec v0.20.8
|
# github.com/go-openapi/spec v0.20.8
|
||||||
## explicit; go 1.13
|
## explicit; go 1.13
|
||||||
github.com/go-openapi/spec
|
github.com/go-openapi/spec
|
||||||
# github.com/go-openapi/swag v0.22.4
|
# github.com/go-openapi/swag v0.22.6
|
||||||
## explicit; go 1.18
|
## explicit; go 1.19
|
||||||
github.com/go-openapi/swag
|
github.com/go-openapi/swag
|
||||||
# github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
|
# github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
|
||||||
## explicit; go 1.13
|
## explicit; go 1.13
|
||||||
|
|||||||
Reference in New Issue
Block a user