Velocity遍历java的JSONObject

#foreach ($!apiParam in $!results.get("fields").entrySet())
          
  $!apiParam.key    
  $!apiParam.value.type        
  $!apiParam.value.desc    
  $!apiParam.value.example

#end

$!results.get("fields")返回的对象是fastjson的JSONObject对象,foreach每次循环访问一个JSONObject对象的一个键值对。

你可能感兴趣的:(Velocity遍历java的JSONObject)