Skip to content

Commit 495de0b

Browse files
committed
add contextValidatable interface
Signed-off-by: Youyuan Wu <[email protected]>
1 parent 1c9920c commit 495de0b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: interfaces.go

+9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package runtime
1616

1717
import (
18+
"context"
1819
"io"
1920
"net/http"
2021

@@ -101,3 +102,11 @@ type Authorizer interface {
101102
type Validatable interface {
102103
Validate(strfmt.Registry) error
103104
}
105+
106+
// ContextValidatable types implementing this interface allow customizing their validation
107+
// this will be used instead of the reflective validation based on the spec document.
108+
// the implementations are assumed to have been generated by the swagger tool so they should
109+
// contain all the context validations obtained from the spec
110+
type ContextValidatable interface {
111+
ContextValidate(context.Context, strfmt.Registry) error
112+
}

0 commit comments

Comments
 (0)