/** * Translates a Restlet Web API Definition to a Swagger definition * * @param definition * The Restlet Web API definition * @return Swagger The translated Swagger 2.0 definition */ public static Swagger getSwagger(Definition definition) { // conversion Swagger swagger = new Swagger(); swagger.setSwagger(SWAGGER_VERSION); // required // fill Swagger main attributes fillSwaggerMainAttributes(definition, swagger); // fill authentication information fillSwaggerAuthentication(definition, swagger); // fill Swagger.info fillSwaggerInfo(definition, swagger); // required // fill Swagger.tags fillTags(definition.getContract(), swagger); // required // fill Swagger.paths fillPaths(definition, swagger); // required // fill Swagger.definitions fillDefinitions(definition, swagger); // TODO add authorization attribute return swagger; }
/** * Translates a Restlet Web API Definition to a Swagger definition * * @param definition * The Restlet Web API definition * @return Swagger The translated Swagger 2.0 definition */ public static Swagger getSwagger(Definition definition) { // conversion Swagger swagger = new Swagger(); swagger.setSwagger(SWAGGER_VERSION); // required // fill Swagger main attributes fillSwaggerMainAttributes(definition, swagger); // fill authentication information fillSwaggerAuthentication(definition, swagger); // fill Swagger.info fillSwaggerInfo(definition, swagger); // required // fill Swagger.tags fillTags(definition.getContract(), swagger); // required // fill Swagger.paths fillPaths(definition, swagger); // required // fill Swagger.definitions fillDefinitions(definition, swagger); // TODO add authorization attribute return swagger; }
/** * Translates a Restlet Web API Definition to a Swagger definition * * @param definition * The Restlet Web API definition * @return Swagger The translated Swagger 2.0 definition */ public static Swagger getSwagger(Definition definition) { // conversion Swagger swagger = new Swagger(); swagger.setSwagger(SWAGGER_VERSION); // required // fill Swagger main attributes fillSwaggerMainAttributes(definition, swagger); // fill authentication information fillSwaggerAuthentication(definition, swagger); // fill Swagger.info fillSwaggerInfo(definition, swagger); // required // fill Swagger.tags fillTags(definition.getContract(), swagger); // required // fill Swagger.paths fillPaths(definition, swagger); // required // fill Swagger.definitions fillDefinitions(definition, swagger); // TODO add authorization attribute return swagger; }
/** * Translates a Restlet Web API Definition to a Swagger definition * * @param definition * The Restlet Web API definition * @return Swagger The translated Swagger 2.0 definition */ public static Swagger getSwagger(Definition definition) { // conversion Swagger swagger = new Swagger(); swagger.setSwagger(SWAGGER_VERSION); // required // fill Swagger main attributes fillSwaggerMainAttributes(definition, swagger); // fill authentication information fillSwaggerAuthentication(definition, swagger); // fill Swagger.info fillSwaggerInfo(definition, swagger); // required // fill Swagger.tags fillTags(definition.getContract(), swagger); // required // fill Swagger.paths fillPaths(definition, swagger); // required // fill Swagger.definitions fillDefinitions(definition, swagger); // TODO add authorization attribute return swagger; }