Isn't the declare {foo:text(text),optional} just following somewhat the ad_page_contract filter syntax?