From 9dc55ec6a04f3b4a810ac23a34bbe80a8875d8d6 Mon Sep 17 00:00:00 2001 From: dylanhitt Date: Mon, 1 Jul 2024 12:55:36 -0400 Subject: [PATCH] fix: enusre the creaion of unknown-interface ref schema when input is nil --- openapi.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openapi.go b/openapi.go index 3fc8b7dc..a2815223 100644 --- a/openapi.go +++ b/openapi.go @@ -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{