return new SwaggerTypeFormat("string"); } else if ("byte".equals(dataType)) { return new SwaggerTypeFormat("string", "byte"); } else if ("short".equals(dataType)) { return new SwaggerTypeFormat("integer", "int32"); } else if ("integer".equals(dataType)) { return new SwaggerTypeFormat("integer", "int32"); } else if ("long".equals(dataType)) { return new SwaggerTypeFormat("integer", "int64"); } else if ("float".equals(dataType)) { return new SwaggerTypeFormat("number", "float"); } else if ("double".equals(dataType)) { return new SwaggerTypeFormat("number", "double"); } else if ("boolean".equals(dataType)) { return new SwaggerTypeFormat("boolean"); } else if ("date".equals(dataType)) { return new SwaggerTypeFormat("string", "date"); } else { return new SwaggerTypeFormat(dataType);
if ("string".equals(dataType.getType())) { if ("date".equals(dataType.getFormat())) { return "date"; } else if ("byte".equals(dataType.getFormat())) { return "byte"; } else { return "string"; } else if ("integer".equals(dataType.getType())) { if ("int64".equals(dataType.getFormat())) { return "long"; } else { return "integer"; } else if ("number".equals(dataType.getType())) { if ("float".equals(dataType.getFormat())) { return "Float"; } else { return "double"; } else if ("boolean".equals(dataType.getType())) { return "boolean"; } else { return dataType.getType();
if ("string".equals(dataType.getType())) { if ("date".equals(dataType.getFormat())) { return "date"; } else if ("byte".equals(dataType.getFormat())) { return "byte"; } else { return "string"; } else if ("integer".equals(dataType.getType())) { if ("int64".equals(dataType.getFormat())) { return "long"; } else { return "integer"; } else if ("number".equals(dataType.getType())) { if ("float".equals(dataType.getFormat())) { return "Float"; } else { return "double"; } else if ("boolean".equals(dataType.getType())) { return "boolean"; } else { return dataType.getType();
return new SwaggerTypeFormat("string"); } else if ("byte".equals(dataType)) { return new SwaggerTypeFormat("string", "byte"); } else if ("short".equals(dataType)) { return new SwaggerTypeFormat("integer", "int32"); } else if ("integer".equals(dataType)) { return new SwaggerTypeFormat("integer", "int32"); } else if ("long".equals(dataType)) { return new SwaggerTypeFormat("integer", "int64"); } else if ("float".equals(dataType)) { return new SwaggerTypeFormat("number", "float"); } else if ("double".equals(dataType)) { return new SwaggerTypeFormat("number", "double"); } else if ("boolean".equals(dataType)) { return new SwaggerTypeFormat("boolean"); } else if ("date".equals(dataType)) { return new SwaggerTypeFormat("string", "date"); } else { return new SwaggerTypeFormat(dataType);
if ("string".equals(dataType.getType())) { if ("date".equals(dataType.getFormat())) { return "date"; } else if ("byte".equals(dataType.getFormat())) { return "byte"; } else { return "string"; } else if ("integer".equals(dataType.getType())) { if ("int64".equals(dataType.getFormat())) { return "long"; } else { return "integer"; } else if ("number".equals(dataType.getType())) { if ("float".equals(dataType.getFormat())) { return "Float"; } else { return "double"; } else if ("boolean".equals(dataType.getType())) { return "boolean"; } else { return dataType.getType();
return new SwaggerTypeFormat("string"); } else if ("byte".equals(dataType)) { return new SwaggerTypeFormat("string", "byte"); } else if ("short".equals(dataType)) { return new SwaggerTypeFormat("integer", "int32"); } else if ("integer".equals(dataType)) { return new SwaggerTypeFormat("integer", "int32"); } else if ("long".equals(dataType)) { return new SwaggerTypeFormat("integer", "int64"); } else if ("float".equals(dataType)) { return new SwaggerTypeFormat("number", "float"); } else if ("double".equals(dataType)) { return new SwaggerTypeFormat("number", "double"); } else if ("boolean".equals(dataType)) { return new SwaggerTypeFormat("boolean"); } else if ("date".equals(dataType)) { return new SwaggerTypeFormat("string", "date"); } else { return new SwaggerTypeFormat(dataType);
if ("string".equals(dataType.getType())) { if ("date".equals(dataType.getFormat())) { return "date"; } else if ("byte".equals(dataType.getFormat())) { return "byte"; } else { return "string"; } else if ("integer".equals(dataType.getType())) { if ("int64".equals(dataType.getFormat())) { return "long"; } else { return "integer"; } else if ("number".equals(dataType.getType())) { if ("float".equals(dataType.getFormat())) { return "Float"; } else { return "double"; } else if ("boolean".equals(dataType.getType())) { return "boolean"; } else { return dataType.getType();
return new SwaggerTypeFormat("string"); } else if ("byte".equals(dataType)) { return new SwaggerTypeFormat("string", "byte"); } else if ("short".equals(dataType)) { return new SwaggerTypeFormat("integer", "int32"); } else if ("integer".equals(dataType)) { return new SwaggerTypeFormat("integer", "int32"); } else if ("long".equals(dataType)) { return new SwaggerTypeFormat("integer", "int64"); } else if ("float".equals(dataType)) { return new SwaggerTypeFormat("number", "float"); } else if ("double".equals(dataType)) { return new SwaggerTypeFormat("number", "double"); } else if ("boolean".equals(dataType)) { return new SwaggerTypeFormat("boolean"); } else if ("date".equals(dataType)) { return new SwaggerTypeFormat("string", "date"); } else { return new SwaggerTypeFormat(dataType);
/** * 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); } }
/** * Converts a Swagger parameter to an instance of * {@link org.restlet.ext.platform.internal.model.PathVariable}. * * @param parameter * The Swagger parameter. * @return An instance of * {@link org.restlet.ext.platform.internal.model.PathVariable}. */ private static PathVariable toPathVariable( ResourceOperationParameterDeclaration parameter) { PathVariable result = new PathVariable(); result.setName(parameter.getName()); result.setDescription(parameter.getDescription()); result.setType(SwaggerTypes.toDefinitionType(new SwaggerTypeFormat( parameter.getType(), parameter.getFormat()))); return result; }
/** * 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); } }
/** * Converts a Swagger parameter to an instance of * {@link org.restlet.ext.platform.internal.model.PathVariable}. * * @param parameter * The Swagger parameter. * @return An instance of * {@link org.restlet.ext.platform.internal.model.PathVariable}. */ private static PathVariable toPathVariable( ResourceOperationParameterDeclaration parameter) { PathVariable result = new PathVariable(); result.setName(parameter.getName()); result.setDescription(parameter.getDescription()); result.setType(SwaggerTypes.toDefinitionType(new SwaggerTypeFormat( parameter.getType(), parameter.getFormat()))); return result; }
/** * 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); } }
/** * Converts a Swagger parameter to an instance of * {@link org.restlet.ext.platform.internal.model.PathVariable}. * * @param parameter * The Swagger parameter. * @return An instance of * {@link org.restlet.ext.platform.internal.model.PathVariable}. */ private static PathVariable toPathVariable( ResourceOperationParameterDeclaration parameter) { PathVariable result = new PathVariable(); result.setName(parameter.getName()); result.setDescription(parameter.getDescription()); result.setType(SwaggerTypes.toDefinitionType(new SwaggerTypeFormat( parameter.getType(), parameter.getFormat()))); return result; }
/** * 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); } }
/** * Converts a Swagger parameter to an instance of * {@link org.restlet.ext.platform.internal.model.PathVariable}. * * @param parameter * The Swagger parameter. * @return An instance of * {@link org.restlet.ext.platform.internal.model.PathVariable}. */ private static PathVariable toPathVariable( ResourceOperationParameterDeclaration parameter) { PathVariable result = new PathVariable(); result.setName(parameter.getName()); result.setDescription(parameter.getDescription()); result.setType(SwaggerTypes.toDefinitionType(new SwaggerTypeFormat( parameter.getType(), parameter.getFormat()))); return result; }
/** * 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); } }