/** * Fills Swagger ResourceOperationDeclaration's * ResourceOperationParameterDeclaration from Restlet Web API definition's * Resource * * @param resource * The Restlet Web API definition's Resource * @param rod * The Swagger Swagger ResourceOperationDeclaration */ private static void fillApiDeclarationPathVariables(Resource resource, ResourceOperationDeclaration rod) { // Get path variables ResourceOperationParameterDeclaration ropd; for (PathVariable pv : resource.getPathVariables()) { ropd = new ResourceOperationParameterDeclaration(); ropd.setParamType("path"); SwaggerTypeFormat swaggerTypeFormat = SwaggerTypes.toSwaggerType(pv .getType()); ropd.setType(swaggerTypeFormat.getType()); ropd.setFormat(swaggerTypeFormat.getFormat()); ropd.setRequired(true); ropd.setName(pv.getName()); ropd.setAllowMultiple(false); ropd.setDescription(pv.getDescription()); rod.getParameters().add(ropd); } }
/** * Fills Swagger ResourceOperationDeclaration's * ResourceOperationParameterDeclaration from Restlet Web API definition's * Resource * * @param resource * The Restlet Web API definition's Resource * @param rod * The Swagger Swagger ResourceOperationDeclaration */ private static void fillApiDeclarationPathVariables(Resource resource, ResourceOperationDeclaration rod) { // Get path variables ResourceOperationParameterDeclaration ropd; for (PathVariable pv : resource.getPathVariables()) { ropd = new ResourceOperationParameterDeclaration(); ropd.setParamType("path"); SwaggerTypeFormat swaggerTypeFormat = SwaggerTypes.toSwaggerType(pv .getType()); ropd.setType(swaggerTypeFormat.getType()); ropd.setFormat(swaggerTypeFormat.getFormat()); ropd.setRequired(true); ropd.setName(pv.getName()); ropd.setAllowMultiple(false); ropd.setDescription(pv.getDescription()); rod.getParameters().add(ropd); } }
/** * Fills Swagger ResourceOperationDeclaration's * ResourceOperationParameterDeclaration from Restlet Web API definition's * Resource * * @param resource * The Restlet Web API definition's Resource * @param rod * The Swagger Swagger ResourceOperationDeclaration */ private static void fillApiDeclarationPathVariables(Resource resource, ResourceOperationDeclaration rod) { // Get path variables ResourceOperationParameterDeclaration ropd; for (PathVariable pv : resource.getPathVariables()) { ropd = new ResourceOperationParameterDeclaration(); ropd.setParamType("path"); SwaggerTypeFormat swaggerTypeFormat = SwaggerTypes.toSwaggerType(pv .getType()); ropd.setType(swaggerTypeFormat.getType()); ropd.setFormat(swaggerTypeFormat.getFormat()); ropd.setRequired(true); ropd.setName(pv.getName()); ropd.setAllowMultiple(false); ropd.setDescription(pv.getDescription()); rod.getParameters().add(ropd); } }
/** * Fills Swagger ResourceOperationDeclaration's * ResourceOperationParameterDeclaration from Restlet Web API definition's * Resource * * @param resource * The Restlet Web API definition's Resource * @param rod * The Swagger Swagger ResourceOperationDeclaration */ private static void fillApiDeclarationPathVariables(Resource resource, ResourceOperationDeclaration rod) { // Get path variables ResourceOperationParameterDeclaration ropd; for (PathVariable pv : resource.getPathVariables()) { ropd = new ResourceOperationParameterDeclaration(); ropd.setParamType("path"); SwaggerTypeFormat swaggerTypeFormat = SwaggerTypes.toSwaggerType(pv .getType()); ropd.setType(swaggerTypeFormat.getType()); ropd.setFormat(swaggerTypeFormat.getFormat()); ropd.setRequired(true); ropd.setName(pv.getName()); ropd.setAllowMultiple(false); ropd.setDescription(pv.getDescription()); rod.getParameters().add(ropd); } }
/** * Fills Swagger ResourceOperationDeclaration's * ResourceOperationParameterDeclaration from Restlet Web API definition's * Operation * * @param operation * The Restlet Web API definition's Operation * @param rod * The Swagger Swagger ResourceOperationDeclaration */ private static void fillApiDeclarationQueryParameters(Operation operation, ResourceOperationDeclaration rod) { // Get query parameters ResourceOperationParameterDeclaration ropd; for (QueryParameter qp : operation.getQueryParameters()) { ropd = new ResourceOperationParameterDeclaration(); ropd.setParamType("query"); SwaggerTypeFormat swaggerTypeFormat = SwaggerTypes.toSwaggerType(qp .getType()); ropd.setType(swaggerTypeFormat.getType()); ropd.setFormat(swaggerTypeFormat.getFormat()); ropd.setName(qp.getName()); ropd.setAllowMultiple(true); ropd.setDescription(qp.getDescription()); ropd.setEnum_(qp.getEnumeration()); ropd.setDefaultValue(qp.getDefaultValue()); ropd.setRequired(qp.isRequired()); rod.getParameters().add(ropd); } }
/** * Fills Swagger ResourceOperationDeclaration's * ResourceOperationParameterDeclaration from Restlet Web API definition's * Operation * * @param operation * The Restlet Web API definition's Operation * @param rod * The Swagger Swagger ResourceOperationDeclaration */ private static void fillApiDeclarationQueryParameters(Operation operation, ResourceOperationDeclaration rod) { // Get query parameters ResourceOperationParameterDeclaration ropd; for (QueryParameter qp : operation.getQueryParameters()) { ropd = new ResourceOperationParameterDeclaration(); ropd.setParamType("query"); SwaggerTypeFormat swaggerTypeFormat = SwaggerTypes.toSwaggerType(qp .getType()); ropd.setType(swaggerTypeFormat.getType()); ropd.setFormat(swaggerTypeFormat.getFormat()); ropd.setName(qp.getName()); ropd.setAllowMultiple(true); ropd.setDescription(qp.getDescription()); ropd.setEnum_(qp.getEnumeration()); ropd.setDefaultValue(qp.getDefaultValue()); ropd.setRequired(qp.isRequired()); rod.getParameters().add(ropd); } }
/** * Fills Swagger ResourceOperationDeclaration's * ResourceOperationParameterDeclaration from Restlet Web API definition's * Operation * * @param operation * The Restlet Web API definition's Operation * @param rod * The Swagger Swagger ResourceOperationDeclaration */ private static void fillApiDeclarationQueryParameters(Operation operation, ResourceOperationDeclaration rod) { // Get query parameters ResourceOperationParameterDeclaration ropd; for (QueryParameter qp : operation.getQueryParameters()) { ropd = new ResourceOperationParameterDeclaration(); ropd.setParamType("query"); SwaggerTypeFormat swaggerTypeFormat = SwaggerTypes.toSwaggerType(qp .getType()); ropd.setType(swaggerTypeFormat.getType()); ropd.setFormat(swaggerTypeFormat.getFormat()); ropd.setName(qp.getName()); ropd.setAllowMultiple(true); ropd.setDescription(qp.getDescription()); ropd.setEnum_(qp.getEnumeration()); ropd.setDefaultValue(qp.getDefaultValue()); ropd.setRequired(qp.isRequired()); rod.getParameters().add(ropd); } }
/** * Fills Swagger ResourceOperationDeclaration's * ResourceOperationParameterDeclaration from Restlet Web API definition's * Operation * * @param operation * The Restlet Web API definition's Operation * @param rod * The Swagger Swagger ResourceOperationDeclaration */ private static void fillApiDeclarationQueryParameters(Operation operation, ResourceOperationDeclaration rod) { // Get query parameters ResourceOperationParameterDeclaration ropd; for (QueryParameter qp : operation.getQueryParameters()) { ropd = new ResourceOperationParameterDeclaration(); ropd.setParamType("query"); SwaggerTypeFormat swaggerTypeFormat = SwaggerTypes.toSwaggerType(qp .getType()); ropd.setType(swaggerTypeFormat.getType()); ropd.setFormat(swaggerTypeFormat.getFormat()); ropd.setName(qp.getName()); ropd.setAllowMultiple(true); ropd.setDescription(qp.getDescription()); ropd.setEnum_(qp.getEnumeration()); ropd.setDefaultValue(qp.getDefaultValue()); ropd.setRequired(qp.isRequired()); rod.getParameters().add(ropd); } }