Search in sources :

Example 1 with CodegenOperation

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;
}
Also used : CodegenOperation(io.swagger.codegen.CodegenOperation)

Example 2 with CodegenOperation

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);
}
Also used : CodegenOperation(io.swagger.codegen.CodegenOperation) DynamicHtmlGen(org.wso2.carbon.apimgt.rest.api.common.codegen.DynamicHtmlGen) CodegenOperation(io.swagger.codegen.CodegenOperation) Operation(io.swagger.models.Operation) Test(org.testng.annotations.Test)

Aggregations

CodegenOperation (io.swagger.codegen.CodegenOperation)2 Operation (io.swagger.models.Operation)1 Test (org.testng.annotations.Test)1 DynamicHtmlGen (org.wso2.carbon.apimgt.rest.api.common.codegen.DynamicHtmlGen)1