File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -2042,6 +2042,26 @@ def get(self):
20422042
20432043 client .get_specs (status = 500 )
20442044
2045+ def test_recursive_model (self , api , client ):
2046+ fields = api .model ('Person' , {
2047+ 'name' : restplus .fields .String ,
2048+ 'age' : restplus .fields .Integer ,
2049+ 'birthdate' : restplus .fields .DateTime
2050+ })
2051+
2052+ fields ["children" ] = restplus .fields .List (
2053+ restplus .fields .Nested (fields ),
2054+ default = [])
2055+
2056+ @api .route ('/recursive-model/' )
2057+ @api .doc (get = {'model' : fields })
2058+ class ModelAsDict (restplus .Resource ):
2059+ @api .marshal_with (fields )
2060+ def get (self ):
2061+ return {}
2062+
2063+ client .get_specs (status = 200 )
2064+
20452065 def test_clone (self , api , client ):
20462066 parent = api .model ('Person' , {
20472067 'name' : restplus .fields .String ,
You can’t perform that action at this time.
0 commit comments