go: vendor the oapi-codegen cmd
See the comment in tools.go, I cannot fully explain what's happening here. Somehow, Go 1.14 wants to use the vendored version of oapi-codegen but without this file, oapi-codegen isn't vendored so the generation fails. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
1a3cbb282a
commit
2241a8d9ed
75 changed files with 11211 additions and 0 deletions
43
vendor/github.com/getkin/kin-openapi/openapi3/security_requirements.go
generated
vendored
Normal file
43
vendor/github.com/getkin/kin-openapi/openapi3/security_requirements.go
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
package openapi3
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type SecurityRequirements []SecurityRequirement
|
||||
|
||||
func NewSecurityRequirements() *SecurityRequirements {
|
||||
return &SecurityRequirements{}
|
||||
}
|
||||
|
||||
func (srs *SecurityRequirements) With(securityRequirement SecurityRequirement) *SecurityRequirements {
|
||||
*srs = append(*srs, securityRequirement)
|
||||
return srs
|
||||
}
|
||||
|
||||
func (srs SecurityRequirements) Validate(c context.Context) error {
|
||||
for _, item := range srs {
|
||||
if err := item.Validate(c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SecurityRequirement map[string][]string
|
||||
|
||||
func NewSecurityRequirement() SecurityRequirement {
|
||||
return make(SecurityRequirement)
|
||||
}
|
||||
|
||||
func (security SecurityRequirement) Authenticate(provider string, scopes ...string) SecurityRequirement {
|
||||
if len(scopes) == 0 {
|
||||
scopes = []string{} // Forces the variable to be encoded as an array instead of null
|
||||
}
|
||||
security[provider] = scopes
|
||||
return security
|
||||
}
|
||||
|
||||
func (security SecurityRequirement) Validate(c context.Context) error {
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue