关于list结构的返回json数据测试 # List结构 api-doc对于List中返回基础数据类型都是支持的 ``` /** * List * * @return */ @GetMapping(value = "listString") public List testList() { return null; } ``` api-doc生成的响应数据 ``` [ "ivvqah","isrz5x"] ``` # List>结构 ``` /** * * @return */ @GetMapping(value = "/map/Primitive") public List> testMap() { return null; } ``` api-doc生成的响应数据 ``` [{ "mapKey1": "o9mibj", "mapKey2": "3dnnrn" }] ``` # List>结构 ``` @GetMapping(value = "/map/Primitive") public List> testMap() { return null; } ``` 相应数据省略 # 测试List结构 ``` /** * 测试List结构 * @return */ @GetMapping(value = "/map/Primitive") public List testMap() { return null; } ``` # List>结构 ``` /** * 测试List>结构 * @return */ @GetMapping(value = "/map/Primitive") public List> testMap() { return null; } ``` # List>>超复杂结构 ``` /** * 测试List>>超复杂结构 * @return */ @GetMapping(value = "/map/Primitive") public List>> testMap() { return null; } ``` api-doc自动返回的数据 ``` [{ "mapKey": { "data": { "userName": "lxh2yi", "userAddress": "6jfp3h", "userAge": 741 }, "data1": { "userName": "1wp54g", "userAddress": "8ul6m4", "userAge": 550 }, "age": 10 } }] ``` # List,List,List>>超复杂结构 ``` /** * List,List,List>> * @return */ @GetMapping(value = "listString") public List,List,List>> testListString(){ return null; } ``` # 其他复杂结构 ``` /** * List,List,List>> * * @return */ @GetMapping(value = "listString") public List,User,User>> testListString() { return null; } @GetMapping(value = "listString") public List,Teacher,Teacher>> testListString() { return null; } ``` **注意:** api-doc为了传入的复杂泛型结构数据,做了许多情况的测试,目前基本能兼容系统开发中95%以上的List返回接口, 也提供了一些能够处理的很复杂的泛型结构,但是这种复杂的泛型结构在开发中是不被推荐的。