@ -247,7 +247,8 @@ class MatrixUnits(Units):
" rows " : [ {
" rows " : [ {
" key " : good_response [ " schema " ] . get ( " name " , " " ) ,
" key " : good_response [ " schema " ] . get ( " name " , " " ) ,
" type " : res_type ,
" type " : res_type ,
" desc " : res . get ( " description " , " " )
" desc " : res . get ( " description " , " " ) ,
" req_str " : " "
} ]
} ]
} )
} )
elif res_type and Units . prop ( good_response , " schema/properties " ) :
elif res_type and Units . prop ( good_response , " schema/properties " ) :
@ -257,6 +258,24 @@ class MatrixUnits(Units):
for table in res_tables :
for table in res_tables :
if " no-table " not in table :
if " no-table " not in table :
endpoint [ " res_tables " ] . append ( table )
endpoint [ " res_tables " ] . append ( table )
elif res_type and Units . prop ( good_response , " schema/items " ) :
# response is an array:
# FIXME: Doesn't recurse at all.
schema = good_response [ " schema " ]
array_type = Units . prop ( schema , " items/type " )
if Units . prop ( schema , " items/allOf " ) :
array_type = (
Units . prop ( schema , " items/title " )
)
endpoint [ " res_tables " ] . append ( {
" title " : schema . get ( " title " , " " ) ,
" rows " : [ {
" key " : " N/A " ,
" type " : ( " [ %s ] " % array_type ) ,
" desc " : schema . get ( " description " , " " ) ,
" req_str " : " "
} ]
} )
endpoints . append ( endpoint )
endpoints . append ( endpoint )