@@ -1581,6 +1581,14 @@ static const char *fmt_indexes(const tal_t *ctx, const char *table)
15811581 return tal_fmt (ctx , " indexed by `%s`" , ret );
15821582}
15831583
1584+ static const char * json_prefix (const tal_t * ctx ,
1585+ const struct table_desc * td )
1586+ {
1587+ if (td -> is_subobject )
1588+ return tal_fmt (ctx , "%s%s." , json_prefix (tmpctx , td -> parent ), td -> cmdname );
1589+ return "" ;
1590+ }
1591+
15841592static void print_columns (const struct table_desc * td , const char * indent ,
15851593 const char * objsrc )
15861594{
@@ -1603,7 +1611,8 @@ static void print_columns(const struct table_desc *td, const char *indent,
16031611 const char * subobjsrc ;
16041612
16051613 subobjsrc = tal_fmt (tmpctx ,
1606- ", from JSON object `%s`" ,
1614+ ", from JSON object `%s%s`" ,
1615+ json_prefix (tmpctx , td ),
16071616 td -> columns [i ]-> jsonname );
16081617 print_columns (subtd , indent , subobjsrc );
16091618 }
@@ -1613,7 +1622,8 @@ static void print_columns(const struct table_desc *td, const char *indent,
16131622 if (streq (objsrc , "" )
16141623 && td -> columns [i ]-> jsonname
16151624 && !streq (td -> columns [i ]-> dbname , td -> columns [i ]-> jsonname )) {
1616- origin = tal_fmt (tmpctx , ", from JSON field `%s`" ,
1625+ origin = tal_fmt (tmpctx , ", from JSON field `%s%s`" ,
1626+ json_prefix (tmpctx , td ),
16171627 td -> columns [i ]-> jsonname );
16181628 } else
16191629 origin = "" ;
0 commit comments