Skip to content

Commit

Permalink
fix: enusre the creaion of unknown-interface ref schema when input is…
Browse files Browse the repository at this point in the history
… nil
  • Loading branch information
dylanhitt committed Jul 9, 2024
1 parent 9a39647 commit 9dc55ec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ type schemaTag struct {

func schemaTagFromType[V any](s *Server, v any) schemaTag {
if v == nil {
// ensure we add unknown-interface to our schemas
s.getOrCreateSchema("unknown-interface", struct{}{})
return schemaTag{
name: "unknown-interface",
SchemaRef: openapi3.SchemaRef{
Expand Down

0 comments on commit 9dc55ec

Please sign in to comment.