Skip to content

Commit b75931b

Browse files
committed
fix: added guard for edge case causing potential panic
* fixes #224 Signed-off-by: Frédéric BIDON <[email protected]>
1 parent 4f79daa commit b75931b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

expander.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,9 @@ func expandParameterOrResponse(input any, resolver *schemaLoader, basePath strin
545545
}
546546

547547
ref, sch, _ = getRefAndSchema(input)
548+
if ref == nil {
549+
ref = &Ref{} // empty ref
550+
}
548551
}
549552

550553
if ref.String() != "" {

0 commit comments

Comments
 (0)