How to get request body and response body in JSON from a Swagger yaml
问题 Here is my code: public static void main(String[] args) { Swagger swagger = new SwaggerParser().read("D:\\espace201612\\rest-services.yaml"); Map<String, Path> paths = swagger.getPaths(); for (Map.Entry<String, Path> p : paths.entrySet()) { Path path = p.getValue(); Map<HttpMethod, Operation> operations = path.getOperationMap(); for (Entry<HttpMethod, Operation> o : operations.entrySet()) { System.out.println("==="); System.out.println("PATH:" + p.getKey()); System.out.println("Http method:"