use of io.swagger.models.Response in project java-chassis by ServiceComb.
the class TestApiResponse method checkMulti.
public void checkMulti(SwaggerGenerator generator) {
Swagger swagger = generator.getSwagger();
Path path = swagger.getPaths().get("/testMulti");
Operation operation = path.getOperations().get(0);
Assert.assertEquals("testMulti", operation.getOperationId());
Response response = operation.getResponses().get("200");
Assert.assertEquals(Integer.class, ConverterMgr.findJavaType(generator, response.getSchema()).getRawClass());
response = operation.getResponses().get("301");
Assert.assertEquals(String.class, ConverterMgr.findJavaType(generator, response.getSchema()).getRawClass());
}
use of io.swagger.models.Response in project java-chassis by ServiceComb.
the class TestApiResponse method checkResponseHeader.
private void checkResponseHeader(SwaggerGenerator generator) {
Swagger swagger = generator.getSwagger();
Path path = swagger.getPaths().get("/testResponseHeader");
Operation operation = path.getOperations().get(0);
Assert.assertEquals("testResponseHeader", operation.getOperationId());
Response response = operation.getResponses().get("200");
Property property = response.getHeaders().get("k1");
Assert.assertEquals(Integer.class, ConverterMgr.findJavaType(generator, property).getRawClass());
}
Aggregations