From 2caeef5e9cd781d90f02b4baf2b452383843f9c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C4=B1l=20=C5=9Eenay?= Date: Thu, 10 Oct 2024 11:06:44 +0300 Subject: [PATCH] Fix recursive error with slice of pointers (#37) --- components/definition/definition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/definition/definition.go b/components/definition/definition.go index 5601738..0d4da22 100644 --- a/components/definition/definition.go +++ b/components/definition/definition.go @@ -138,7 +138,7 @@ func (g DefinitionGenerator) createStructDefinitions(structType reflect.Type) ma }, IsRequired: g.isRequired(field), } - if structType == field.Type.Elem() { + if structType == field.Type.Elem().Elem() { continue // prevent recursion } g.CreateDefinition(reflect.New(field.Type.Elem().Elem()).Elem().Interface())