use of io.swagger.codegen.CodegenOperation in project carbon-apimgt by wso2.
the class DynamicHtmlGen method fromOperation.
@Override
public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map<String, Model> definitions, Swagger swagger) {
CodegenOperation op = super.fromOperation(path, httpMethod, operation, definitions, swagger);
op.summary = operation.getSummary();
op.notes = operation.getDescription();
return op;
}
use of io.swagger.codegen.CodegenOperation in project carbon-apimgt by wso2.
the class DynamicHtmlGenTestCase method testFromOperation.
@Test
public void testFromOperation() throws Exception {
Operation operation = new Operation();
final String summary = "Sample operation summary";
final String description = "Sample operation description";
operation.setDescription(description);
operation.setSummary(summary);
DynamicHtmlGen htmlGen = new DynamicHtmlGen();
CodegenOperation modified = htmlGen.fromOperation("/apis", "GET", operation, null, null);
Assert.assertEquals(modified.summary, summary);
Assert.assertEquals(modified.notes, description);
}
Aggregations