@@ -159,6 +159,42 @@ function test_validations()
159159 return nothing
160160end
161161
162+ struct TestHasPropertyInner <: OpenAPI.APIModel
163+ testval:: Union{Nothing,String}
164+
165+ function TestHasPropertyInner (; testval= nothing )
166+ return new (testval)
167+ end
168+ end
169+
170+ struct TestHasProperty <: OpenAPI.APIModel
171+ inner:: Union{Nothing,TestHasPropertyInner}
172+
173+ function TestHasProperty (; inner= nothing )
174+ return new (inner)
175+ end
176+ end
177+
178+ function test_has_property ()
179+ teststruct = TestHasProperty ()
180+
181+ @test ! OpenAPI. Clients. haspropertyat (teststruct, :inner , :testval )
182+ @test ! OpenAPI. Clients. haspropertyat (teststruct, " inner" , " testval" )
183+ @test ! OpenAPI. Clients. haspropertyat (teststruct, :inner )
184+
185+ teststruct = TestHasProperty (; inner= TestHasPropertyInner ())
186+ @test ! OpenAPI. Clients. haspropertyat (teststruct, :inner , :testval )
187+ @test ! OpenAPI. Clients. haspropertyat (teststruct, " inner" , " testval" )
188+ @test OpenAPI. Clients. haspropertyat (teststruct, :inner )
189+
190+ teststruct = TestHasProperty (; inner= TestHasPropertyInner (; testval= " test" ))
191+ @test OpenAPI. Clients. haspropertyat (teststruct, :inner , :testval )
192+ @test OpenAPI. Clients. haspropertyat (teststruct, " inner" , " testval" )
193+ @test OpenAPI. Clients. haspropertyat (teststruct, :inner )
194+ @test OpenAPI. Clients. getpropertyat (teststruct, :inner , :testval ) == " test"
195+ end
196+
197+
162198struct InvalidModel <: OpenAPI.APIModel
163199 test:: Any
164200
0 commit comments