mirror of
https://github.com/Fishwaldo/huma.git
synced 2025-03-15 19:31:27 +00:00
Merge pull request #2 from hvanvoorhis-ISP/patch-1
Update dependency.go
This commit is contained in:
commit
5bf4593498
1 changed files with 1 additions and 1 deletions
|
@ -94,7 +94,7 @@ func (d *openAPIDependency) validate(returnType reflect.Type) {
|
|||
v := reflect.ValueOf(d.handler)
|
||||
|
||||
if v.Kind() != reflect.Func {
|
||||
if returnType != nil && returnType != v.Type() {
|
||||
if returnType != nil && returnType != v.Type() && !v.Type().Implements(returnType) {
|
||||
panic(fmt.Errorf("return type should be %s but got %s: %w", v.Type(), returnType, ErrDependencyInvalid))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue