All Downloads are FREE. Search and download functionalities are using the official Maven repository.

s.EpikosRestService.0.0.7.5.1.source-code.SwaggerApiTemplate Maven / Gradle / Ivy

Go to download

Epikos is a Rest Serivce framework which can be extend to develop any other Rest API/Services. For more detail please checkout github (https://github.com/epikosrest/epikos.git)

There is a newer version: 0.0.7.8.1
Show newest version
//Ref https://www.quora.com/How-can-I-dynamically-create-a-Java-class-and-execute-its-methods-at-runtime
//Include Package if it suppose to be part of package here and don't forget to update SwaggerApiTemplateLoader.java accordingly
package external.swagger;

import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiResponse;
import com.wordnik.swagger.annotations.ApiResponses;
import core.error.EpikosError;
import example.response.Response;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

/**
 * Created by nitina on 2/19/17.
 */
//@Path("swagger")
//@Api(value = "%ApiValue%", description = "%ApiDescription%")
@Api(value = "Api Doc", description = "Swagger documentation for API(s)")
public class SwaggerApiDocumentation { //implements Runnable{


    @GET
    @Path("swagger/doc1")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(value = "First API", notes = "More notes about this method 1", response = Response.class)
    @ApiResponses(value = {
            @ApiResponse(code = 400, message = "Invalid ID supplied 1", response = EpikosError.class),
            @ApiResponse(code = 500, message = "Server is down! 1", response = EpikosError.class)})
    //@ApiOperation(value = "%ApiOperationValue%", notes = "%ApiOperationNotes%", response = "%ApiOperationResponse%")
    /*@ApiResponses(value = {
            @ApiResponse(code = 400, message = "Invalid ID supplied 1", response = EpikosException.class),
            @ApiResponse(code = 500, message = "Server is down! 1" , response = EpikosException.class)
    })*/
    public void process0() {
        //Response res =  new Response();
        //res.setTest("first response 1");
        //return res;

    }

    /*
    public void run(){
        System.out.println("************** ???????????? test runnalble ???????????????????? ****************");
    }
    */

    @GET
    @Path("swagger/doc2")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(value = "A operation", notes = "More notes about this method 2", response = Response.class)
    @ApiResponses(value = {
            @ApiResponse(code = 400, message = "Invalid ID supplied 2", response = EpikosError.class),
            @ApiResponse(code = 500, message = "Server is down! 2", response = EpikosError.class)
    })
    public void process1()  {
        //Do nothing as its proxy
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy