From fcfe7c3f266dfbcb09dc246b973fd00a39bcc481 Mon Sep 17 00:00:00 2001 From: Daniel Castro Date: Sat, 15 Oct 2022 17:06:02 +0000 Subject: [PATCH] initial commit --- openapi3filter/errors.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openapi3filter/errors.go b/openapi3filter/errors.go index 1094bcf75..b5454a75c 100644 --- a/openapi3filter/errors.go +++ b/openapi3filter/errors.go @@ -1,6 +1,7 @@ package openapi3filter import ( + "bytes" "fmt" "github.com/getkin/kin-openapi/openapi3" @@ -78,5 +79,14 @@ type SecurityRequirementsError struct { } func (err *SecurityRequirementsError) Error() string { - return "Security requirements failed" + buff := &bytes.Buffer{} + buff.WriteString("security requirements failed: ") + for i, e := range err.Errors { + buff.WriteString(e.Error()) + if i != len(err.Errors)-1 { + buff.WriteString(" | ") + } + } + + return buff.String() }