io.swagger.annotations.ApiResponses源码实例Demo

类io.swagger.annotations.ApiResponses源码实例Demo

下面列出了io.swagger.annotations.ApiResponses 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: commerce-cif-api   文件: CartApi.java
@POST
@Path("/{id}/payments")
@ApiOperation(value = "Adds a payment to this shopping cart.")
@ApiResponses(value = {
    @ApiResponse(code = HTTP_OK, message = HTTP_OK_MESSAGE, response = Cart.class),
    @ApiResponse(code = HTTP_BAD_REQUEST, message = HTTP_BAD_REQUEST_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_FORBIDDEN, message = HTTP_FORBIDDEN_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_NOT_FOUND, message = HTTP_NOT_FOUND_MESSAGE, response = ErrorResponse.class)
})
@Consumes(MediaType.APPLICATION_JSON)
Cart postCartPayment(
    @ApiParam(value = "The ID of the cart for which the payment will be set.", required = true)
    @PathParam("id") String id,

    @ApiParam(value = "The payment to create. If the cart belongs to a customer, the customer id must be set.", required = true)
    PaymentWrapper paymentWrapper,

    @ApiParam(value = ACCEPT_LANGUAGE_DESC)
    @HeaderParam(ACCEPT_LANGUAGE) String acceptLanguage);
 
源代码2 项目: activiti6-boot2   文件: TaskResource.java
@ApiOperation(value = "Delete a task", tags = {"Tasks"})
@ApiResponses(value = {
    @ApiResponse(code = 204, message =  "Indicates the task was found and has been deleted. Response-body is intentionally empty."),
    @ApiResponse(code = 403, message = "Indicates the requested task cannot be deleted because it’s part of a workflow."),
    @ApiResponse(code = 404, message = "Indicates the requested task was not found.")
})	  
@RequestMapping(value = "/runtime/tasks/{taskId}", method = RequestMethod.DELETE)
public void deleteTask(@ApiParam(name="taskId", value="The id of the task to delete.") @PathVariable String taskId,@ApiParam(hidden=true) @RequestParam(value = "cascadeHistory", required = false) Boolean cascadeHistory,
    @ApiParam(hidden=true) @RequestParam(value = "deleteReason", required = false) String deleteReason, HttpServletResponse response) {

  Task taskToDelete = getTaskFromRequest(taskId);
  if (taskToDelete.getExecutionId() != null) {
    // Can't delete a task that is part of a process instance
    throw new ActivitiForbiddenException("Cannot delete a task that is part of a process-instance.");
  }

  if (cascadeHistory != null) {
    // Ignore delete-reason since the task-history (where the reason is
    // recorded) will be deleted anyway
    taskService.deleteTask(taskToDelete.getId(), cascadeHistory);
  } else {
    // Delete with delete-reason
    taskService.deleteTask(taskToDelete.getId(), deleteReason);
  }
  response.setStatus(HttpStatus.NO_CONTENT.value());
}
 
源代码3 项目: commerce-cif-api   文件: ShoppingListApi.java
@GET
@Path("/")
@ApiOperation(value = "Gets a users shopping lists.",
              notes = "The entries property is empty for all shopping lists in the response. To retrieve entries, query a single shopping list.")
@ApiResponses(value = {
    @ApiResponse(code = HTTP_BAD_REQUEST, message = HTTP_BAD_REQUEST_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_UNAUTHORIZED, message = HTTP_UNAUTHORIZED_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_NOT_FOUND, message = HTTP_NOT_FOUND_MESSAGE, response = ErrorResponse.class)
})
PagedResponse<ShoppingList> getShoppingLists(
    @ApiParam(value = "Defines the number of shopping lists to skip.")
    @QueryParam(value = "offset")
    @Min(value = 0)
    Integer offset,

    @ApiParam(value = "Defines the maximum number of shopping lists to be returned.")
    @QueryParam(value = "limit")
    @Min(value = 0)
    Integer limit,

    @ApiParam(value = ACCEPT_LANGUAGE_DESC)
    @HeaderParam(ACCEPT_LANGUAGE) String acceptLanguage
);
 
源代码4 项目: BlogManagePlatform   文件: SuccessPlugin.java
@Override
public void apply(OperationContext context) {
	//TODO:这样做屏蔽了@ResponseHeader的功能,因为没有了该注解。
	//由于本项目header为统一配置,故未实现替代功能。有必要的话需要提供一个替代实现。
	if (context.findAnnotation(ApiResponses.class).isPresent()) {
		return;
	}
	Optional<Success> annotation = context.findAnnotation(Success.class);
	if (!annotation.isPresent()) {
		context.operationBuilder().responseMessages(okResponses);
		return;
	}
	ResponseMessageBuilder messageBuilder = new ResponseMessageBuilder();
	messageBuilder.code(HttpStatus.OK.value());
	messageBuilder.message(okMessage);
	ModelReference model = resolveModel(context, annotation.get());
	messageBuilder.responseModel(model);
	context.operationBuilder().responseMessages(Set.of(messageBuilder.build()));
}
 
源代码5 项目: Bhadoo-Cloud-Drive   文件: StatusController.java
@GetMapping
@ApiOperation(value = "gives array of upload information of current user.", response = UploadInformation[].class)
@ApiResponses({
		@ApiResponse(code = 500, message = "There is something wrong at server side. Please contact developers.", response = ApiError.class) })
public List<UploadInformation> handleStatusRequest() {

	@SuppressWarnings("unchecked")
	List<String> uploads = (List<String>) session.getAttribute("uploads");
	List<UploadInformation> uploadInformations = new ArrayList<>();

	if (uploads != null)
		uploads.forEach((id) -> uploadInformations.add(UploadManager.getUploadManager().getUploadInformation(id)));

	Collections.reverse(uploadInformations);
	return uploadInformations;
}
 
/**
 *
 * @param sourceWord
 * @param targetWord
 * @param maxEd
 * @return
 */
@ApiOperation(
    value = "API for calculating the Edit  Distance",
    notes =
        "For given source and target String calculate the Edit Distance",
    code = 200,
    response = Response.class)
@ApiResponses(
    value = {
        @ApiResponse(
            code = 400,
            message = "SpellCheckExceptions",
            response = Response.class),
        @ApiResponse(code = 200, response = Response.class, message = "")
    })
@GetMapping("/spellcheck/")
public Response getEditDistance(
    @Valid @RequestParam(name = "source") String sourceWord,
    @Valid @RequestParam(name = "target") String targetWord,
    @RequestParam(name = "maxED", required = false) Double maxEd) {
  if (maxEd != null) {
    return service.getEditDistance(sourceWord, targetWord, maxEd);
  }
  return service.getEditDistance(sourceWord, targetWord);
}
 
/**
 * Sample usage: curl $HOST:$PORT/product-composite/1
 *
 * @param productId
 * @return the composite product info, if found, else null
 */
@ApiOperation(
    value = "${api.product-composite.get-composite-product.description}",
    notes = "${api.product-composite.get-composite-product.notes}")
@ApiResponses(value = {
    @ApiResponse(code = 400, message = "Bad Request, invalid format of the request. See response message for more information."),
    @ApiResponse(code = 404, message = "Not found, the specified id does not exist."),
    @ApiResponse(code = 422, message = "Unprocessable entity, input parameters caused the processing to fail. See response message for more information.")
})
@GetMapping(
    value    = "/product-composite/{productId}",
    produces = "application/json")
Mono<ProductAggregate> getCompositeProduct(
    @PathVariable int productId,
    @RequestParam(value = "delay", required = false, defaultValue = "0") int delay,
    @RequestParam(value = "faultPercent", required = false, defaultValue = "0") int faultPercent
);
 
@ApiOperation(value = "Get the exception stacktrace for a suspended job", tags = {"Jobs"})
@ApiResponses(value = {
    @ApiResponse(code = 200, message = "Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain."),
    @ApiResponse(code = 404, message = "Indicates the requested job was not found or the job doesn’t have an exception stacktrace. Status-description contains additional information about the error.")
})
@RequestMapping(value = "/management/suspended-jobs/{jobId}/exception-stacktrace", method = RequestMethod.GET)
public String getSuspendedJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response) {
  Job job = managementService.createSuspendedJobQuery().jobId(jobId).singleResult();
  if (job == null) {
    throw new ActivitiObjectNotFoundException("Could not find a job with id '" + jobId + "'.", Job.class);
  }

  String stackTrace = managementService.getSuspendedJobExceptionStacktrace(job.getId());

  if (stackTrace == null) {
    throw new ActivitiObjectNotFoundException("Suspended job with id '" + job.getId() + "' doesn't have an exception stacktrace.", String.class);
  }

  response.setContentType("text/plain");
  return stackTrace;
}
 
源代码9 项目: AuTe-Framework   文件: RestScenarioController.java
@ApiOperation(
        value = "Gets list of steps for given scenario code",
        notes = "If scenario doesn`t exist, new empty scenario will be created",
        nickname = "findSteps",
        produces = MediaType.APPLICATION_JSON_VALUE,
        tags = {SpringfoxConfig.TAG_SCENARIO, SpringfoxConfig.TAG_STEP}
)
@ApiResponses({
        @ApiResponse(code = 200, message = "List of steps for scenario"),
        @ApiResponse(code = 404, message = "Scenario haven`t been loaded"),
        @ApiResponse(code = 500, message = "Server error. Cannot read scenario from file")
})
@RequestMapping(value = { "{scenarioCode:.+}/steps", "{scenarioGroup:.+}/{scenarioCode:.+}/steps" }, method = RequestMethod.GET)
public List<StepRo> findSteps(
        @PathVariable String projectCode,
        @PathVariable(required = false) String scenarioGroup,
        @PathVariable String scenarioCode) throws IOException {
    String scenarioPath = (StringUtils.isEmpty(scenarioGroup) ? "" : scenarioGroup + "/") + scenarioCode;
    Scenario scenario = scenarioService.findOne(projectCode, scenarioPath);
    if (scenario != null) {
        return stepRoMapper.convertStepListToStepRoList(scenario.getStepList());
    }
    throw new ResourceNotFoundException();
}
 
源代码10 项目: AuTe-Framework   文件: RestScenarioController.java
@ApiOperation(
        value = "Gets scenario by given code",
        notes = "If scenario doesn`t exist, new empty scenario will be created",
        nickname = "findOne",
        produces = MediaType.APPLICATION_JSON_VALUE
)
@ApiResponses({
        @ApiResponse(code = 200, message = "Scenario"),
        @ApiResponse(code = 404, message = "Scenario haven`t been loaded"),
        @ApiResponse(code = 500, message = "Server error. Cannot read scenario from file")
})
@RequestMapping(value = { "{scenarioCode:.+}", "{scenarioGroup:.+}/{scenarioCode:.+}" }, method = RequestMethod.GET)
public ScenarioRo findOne(
        @PathVariable String projectCode,
        @PathVariable(required = false) String scenarioGroup,
        @PathVariable String scenarioCode) throws IOException {
    String scenarioPath = (StringUtils.isEmpty(scenarioGroup) ? "" : scenarioGroup + "/") + scenarioCode;
    Scenario scenario = scenarioService.findOne(projectCode, scenarioPath);
    if (scenario != null) {
        // TODO Set projectName
        return projectRoMapper.scenarioToScenarioRo(projectCode, scenario);
    }
    throw new ResourceNotFoundException();
}
 
源代码11 项目: pulsar-manager   文件: RolesController.java
@ApiOperation(value = "Get resource type")
@ApiResponses({
        @ApiResponse(code = 200, message = "ok"),
        @ApiResponse(code = 404, message = "Not found"),
        @ApiResponse(code = 500, message = "Internal server error")
})
@RequestMapping(value = "/role/resourceType", method = RequestMethod.GET)
public ResponseEntity<Map<String, Object>> getResourceType() {
    Map<String, Object> result = Maps.newHashMap();
    Set<String> resourceTypeList = Sets.newHashSet();
    resourceTypeList.add(ResourceType.NAMESPACES.name());
    resourceTypeList.add(ResourceType.TOPICS.name());
    resourceTypeList.add(ResourceType.SCHEMAS.name());
    resourceTypeList.add(ResourceType.FUNCTIONS.name());
    result.put("resourceType", resourceTypeList);
    return ResponseEntity.ok(result);
}
 
源代码12 项目: AuTe-Framework   文件: RestProjectController.java
@ApiOperation(
        value = "Gets project by its code",
        nickname = "findOne",
        produces = MediaType.APPLICATION_JSON_VALUE
)
@ApiResponses({
        @ApiResponse(code = 200, message = "Project data"),
        @ApiResponse(code = 404, message = "Project with given code not found")
})
@RequestMapping(value = "{projectCode}", method = RequestMethod.GET)
public ProjectRo findOne(@PathVariable String projectCode) {
    Project project = projectService.findOne(projectCode);
    if (project != null) {
        return projectRoMapper.projectToProjectRo(project);
    }
    throw new ResourceNotFoundException();
}
 
@ApiOperation(value = "List resources in a deployment", tags = {"Deployment"}, notes="The dataUrl property in the resulting JSON for a single resource contains the actual URL to use for retrieving the binary resource.")
@ApiResponses(value = {
    @ApiResponse(code = 200, message = "Indicates the deployment was found and the resource list has been returned."),
    @ApiResponse(code = 404, message = "Indicates the requested deployment was not found.")
})
@RequestMapping(value = "/repository/deployments/{deploymentId}/resources", method = RequestMethod.GET, produces = "application/json")
public List<DeploymentResourceResponse> getDeploymentResources(@ApiParam(name = "deploymentId", value = "The id of the deployment to get the resources for.") @PathVariable String deploymentId, HttpServletRequest request) {
  // Check if deployment exists
  Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
  if (deployment == null) {
    throw new ActivitiObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", Deployment.class);
  }

  List<String> resourceList = repositoryService.getDeploymentResourceNames(deploymentId);

  return restResponseFactory.createDeploymentResourceResponseList(deploymentId, resourceList, contentTypeResolver);
}
 
源代码14 项目: pulsar-manager   文件: NamespacesController.java
@ApiOperation(value = "Query list by the name of tenant or namespace, support paging, the default is 10 per page")
@ApiResponses({
        @ApiResponse(code = 200, message = "ok"),
        @ApiResponse(code = 500, message = "Internal server error")
})
@RequestMapping(value = "/namespaces/{tenantOrNamespace}", method = RequestMethod.GET)
public ResponseEntity<Map<String, Object>> getNamespacesByTenant(
        @ApiParam(value = "The name of tenant or namespace.")
        @Size(min = 1, max = 255)
        @PathVariable String tenantOrNamespace,
        @ApiParam(value = "page_num", defaultValue = "1", example = "1")
        @RequestParam(name = "page_num", defaultValue = "1")
        @Min(value = 1, message = "page_num is incorrect, should be greater than 0.")
                Integer pageNum,
        @ApiParam(value = "page_size", defaultValue = "10", example = "10")
        @RequestParam(name="page_size", defaultValue = "10")
        @Range(min = 1, max = 1000, message = "page_size is incorrect, should be greater than 0 and less than 1000.")
        Integer pageSize) {
    String requestHost = environmentCacheService.getServiceUrl(request);
    Map<String, Object> result = namespacesService.getNamespaceList(pageNum, pageSize, tenantOrNamespace, requestHost);
    return ResponseEntity.ok(result);
}
 
源代码15 项目: commerce-cif-api   文件: ShoppingListApi.java
@GET
@Path("/{id}")
@ApiOperation(value = "Gets a users shopping list with a given id.")
@ApiResponses(value = {
    @ApiResponse(code = HTTP_BAD_REQUEST, message = HTTP_BAD_REQUEST_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_UNAUTHORIZED, message = HTTP_UNAUTHORIZED_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_NOT_FOUND, message = HTTP_NOT_FOUND_MESSAGE, response = ErrorResponse.class)
})
ShoppingList getShoppingList(
    @ApiParam(value = "The id of the shopping list to return.", required = true)
    @PathParam("id")
    String id,

    @ApiParam(value = ACCEPT_LANGUAGE_DESC)
    @HeaderParam(ACCEPT_LANGUAGE) String acceptLanguage
);
 
源代码16 项目: commerce-cif-api   文件: CartApi.java
@DELETE
@Path("/{id}/entries/{cartEntryId}")
@ApiOperation(value = "Removes a cart entry from the cart.")
@ApiResponses(value = {
    @ApiResponse(code = HTTP_OK, message = HTTP_OK_MESSAGE, response = Cart.class),
    @ApiResponse(code = HTTP_BAD_REQUEST, message = HTTP_BAD_REQUEST_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_FORBIDDEN, message = HTTP_FORBIDDEN_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_NOT_FOUND, message = HTTP_NOT_FOUND_MESSAGE, response = ErrorResponse.class)
})
Cart deleteCartEntry(
    @ApiParam(value = "The ID of the cart.", required = true)
    @PathParam("id") String id,

    @ApiParam(value = "The cart entry id to be removed.", required = true)
    @PathParam("cartEntryId") String cartEntryId,

    @ApiParam(value = ACCEPT_LANGUAGE_DESC)
    @HeaderParam(ACCEPT_LANGUAGE) String acceptLanguage);
 
源代码17 项目: commerce-cif-api   文件: ShoppingListApi.java
@GET
@Path("/{id}/entries")
@ApiOperation(value = "Gets all entries from a shopping list.")
@ApiResponses(value = {
    @ApiResponse(code = HTTP_BAD_REQUEST, message = HTTP_BAD_REQUEST_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_UNAUTHORIZED, message = HTTP_UNAUTHORIZED_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_NOT_FOUND, message = HTTP_NOT_FOUND_MESSAGE, response = ErrorResponse.class)
})
PagedResponse<ShoppingListEntry> getShoppingListEntries(
    @ApiParam(value = "The id of the shopping list to return entries from.", required = true)
    @PathParam("id")
    String id,

    @ApiParam(value = "Defines the number of entries to skip.")
    @QueryParam(value = "offset")
    @Min(value = 0)
    Integer offset,

    @ApiParam(value = "Defines the maximum number of entries to be returned.")
    @QueryParam(value = "limit")
    @Min(value = 0)
    Integer limit,

    @ApiParam(value = ACCEPT_LANGUAGE_DESC)
    @HeaderParam(ACCEPT_LANGUAGE) String acceptLanguage
);
 
@ApiOperation(value = "Delete a candidate starter from a process definition", tags = {"Process Definitions"})
@ApiResponses(value = {
    @ApiResponse(code = 204, message = "Indicates the process definition was found and the identity link was removed. The response body is intentionally empty."),
    @ApiResponse(code = 404, message = "Indicates the requested process definition was not found or the process definition doesn’t have an identity-link that matches the url.")
})
@RequestMapping(value = "/repository/process-definitions/{processDefinitionId}/identitylinks/{family}/{identityId}", method = RequestMethod.DELETE)
public void deleteIdentityLink(@ApiParam(name = "processDefinitionId", value="The id of the process definition.")  @PathVariable("processDefinitionId") String processDefinitionId,@ApiParam(name = "family", value="Either users or groups, depending on the type of identity link.") @PathVariable("family") String family,@ApiParam(name = "identityId", value="Either the user or group of the identity to remove as candidate starter.") @PathVariable("identityId") String identityId,
    HttpServletResponse response) {

  ProcessDefinition processDefinition = getProcessDefinitionFromRequest(processDefinitionId);

  validateIdentityLinkArguments(family, identityId);

  // Check if identitylink to delete exists
  IdentityLink link = getIdentityLink(family, identityId, processDefinition.getId());
  if (link.getUserId() != null) {
    repositoryService.deleteCandidateStarterUser(processDefinition.getId(), link.getUserId());
  } else {
    repositoryService.deleteCandidateStarterGroup(processDefinition.getId(), link.getGroupId());
  }

  response.setStatus(HttpStatus.NO_CONTENT.value());
}
 
源代码19 项目: commerce-cif-api   文件: ShoppingListApi.java
@PUT
@Path("/{id}")
@ApiOperation(value = "Replaces a shopping list with the given one.")
@ApiResponses(value = {
    @ApiResponse(code = HTTP_BAD_REQUEST, message = HTTP_BAD_REQUEST_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_UNAUTHORIZED, message = HTTP_UNAUTHORIZED_MESSAGE, response = ErrorResponse.class),
    @ApiResponse(code = HTTP_NOT_FOUND, message = HTTP_NOT_FOUND_MESSAGE, response = ErrorResponse.class)
})
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
ShoppingList putShoppingList(
    @ApiParam(value = "The id of the shopping list to replace.", required = true)
    @PathParam("id")
    String id,

    @ApiParam(value = "Name of the shopping list.", required = true)
    @FormParam("name")
    String name,

    @ApiParam(value = "Description of the shopping list.")
    @FormParam("description")
    String description,

    @ApiParam(value = ACCEPT_LANGUAGE_DESC)
    @HeaderParam(ACCEPT_LANGUAGE) String acceptLanguage
);
 
源代码20 项目: openapi-generator   文件: PetApi.java
/**
 * Add a new pet to the store
 *
 */
@POST
@Path("/pet")
@Consumes({ "application/json", "application/xml" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Add a new pet to the store", tags={  })
@ApiResponses(value = { 
    @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
    @ApiResponse(code = 405, message = "Invalid input") })
public Pet addPet(Pet pet);
 
源代码21 项目: Java-EE-8-and-Angular   文件: UsersResource.java
@POST
@ApiOperation(value = "Create user",
        notes = "This can only be done by the logged in user.")
@ApiResponses(value = {
    @ApiResponse(code = 400, message = "Invalid user input")
    ,
    @ApiResponse(code = 201, message = "User added")})
public Response add(@ApiParam(value = "User that needs to be added", required = true) User newUser, @Context UriInfo uriInfo) {
    service.add(newUser);
    return Response.created(getLocation(uriInfo, newUser.getId())).build();
}
 
@ApiOperation(value = "Query for historic task instances", tags = { "History" }, nickname = "queryHistoricTaskInstance",
    notes = "All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of historic task instances, but passed in as JSON-body arguments rather than URL-parameters to allow for more advanced querying and preventing errors with request-uri’s that are too long. On top of that, the query allows for filtering based on process variables. The taskVariables and processVariables properties are JSON-arrays containing objects with the format as described here.")
@ApiResponses(value = {
    @ApiResponse(code = 200, message = "Indicates request was successful and the tasks are returned"),
    @ApiResponse(code = 404, message = "Indicates an parameter was passed in the wrong format. The status-message contains additional information.") })
@RequestMapping(value = "/query/historic-task-instances", method = RequestMethod.POST, produces = "application/json")
public DataResponse queryProcessInstances(@RequestBody HistoricTaskInstanceQueryRequest queryRequest,@ApiParam(hidden=true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request) {

  return getQueryResponse(queryRequest, allRequestParams, request.getRequestURL().toString().replace("/query/historic-task-instances", ""));
}
 
源代码23 项目: openapi-generator   文件: PetApi.java
/**
 * Update an existing pet
 *
 */
@PUT
@Path("/pet")
@Consumes({ "application/json", "application/xml" })
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Update an existing pet", tags={  })
@ApiResponses(value = { 
    @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
    @ApiResponse(code = 400, message = "Invalid ID supplied"),
    @ApiResponse(code = 404, message = "Pet not found"),
    @ApiResponse(code = 405, message = "Validation exception") })
public Pet updatePet(Pet pet);
 
源代码24 项目: openapi-generator   文件: UserApi.java
/**
 * Get user by user name
 *
 */
@GET
@Path("/user/{username}")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Get user by user name", tags={ "user",  })
@ApiResponses(value = { 
    @ApiResponse(code = 200, message = "successful operation", response = User.class),
    @ApiResponse(code = 400, message = "Invalid username supplied"),
    @ApiResponse(code = 404, message = "User not found") })
public User getUserByName(@PathParam("username") String username);
 
@ApiOperation(value = "Get all comments on a task", tags = {"Tasks"}, nickname = "listTaskComments")
@ApiResponses(value = {
    @ApiResponse(code = 201, message = "Indicates the task was found and the comments are returned."),
    @ApiResponse(code = 404, message = "Indicates the requested task was not found.")
})	
@RequestMapping(value = "/runtime/tasks/{taskId}/comments", method = RequestMethod.GET, produces = "application/json")
public List<CommentResponse> getComments(@ApiParam(name = "taskId", value="The id of the task to get the comments for.") @PathVariable String taskId, HttpServletRequest request) {
  HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
  return restResponseFactory.createRestCommentList(taskService.getTaskComments(task.getId()));
}
 
源代码26 项目: openapi-generator   文件: UserApi.java
/**
 * Logs user into the system
 *
 */
@GET
@Path("/user/login")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Logs user into the system", tags={ "user",  })
@ApiResponses(value = { 
    @ApiResponse(code = 200, message = "successful operation", response = String.class),
    @ApiResponse(code = 400, message = "Invalid username/password supplied") })
public String loginUser(@QueryParam("username") @NotNull  String username, @QueryParam("password") @NotNull  String password);
 
源代码27 项目: openapi-generator   文件: PetApi.java
/**
 * Updates a pet in the store with form data
 *
 */
@POST
@Path("/pet/{petId}")
@Consumes({ "application/x-www-form-urlencoded" })
@ApiOperation(value = "Updates a pet in the store with form data", tags={ "pet",  })
@ApiResponses(value = { 
    @ApiResponse(code = 405, message = "Invalid input") })
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false)  String name, @Multipart(value = "status", required = false)  String status);
 
源代码28 项目: data-highway   文件: HiveDestinationController.java
@ApiOperation(value = "Returns details of a Hive destination")
@ApiResponses({
    @ApiResponse(code = 200, message = "Details of a Hive destination.", response = StandardResponse.class),
    @ApiResponse(code = 404, message = "Road or Hive destination not found.", response = StandardResponse.class) })
@GetMapping
public HiveDestinationModel get(@PathVariable String name) throws UnknownRoadException, UnknownDestinationException {
  return hiveDestinationService.getHiveDestination(name);
}
 
源代码29 项目: openapi-generator   文件: PetApi.java
/**
 * Deletes a pet
 *
 */
@DELETE
@Path("/pet/{petId}")
@ApiOperation(value = "Deletes a pet", tags={ "pet",  })
@ApiResponses(value = { 
    @ApiResponse(code = 400, message = "Invalid pet value") })
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key")   String apiKey);
 
@ApiOperation(value = "List of variables for a process instance", tags = { "Process Instances" },
    notes="In case the variable is a binary variable or serializable, the valueUrl points to an URL to fetch the raw value. If it’s a plain variable, the value is present in the response. Note that only local scoped variables are returned, as there is no global scope for process-instance variables.")
@ApiResponses(value = {
    @ApiResponse(code = 200, message = "Indicates the process instance was found and variables are returned."),
    @ApiResponse(code = 400, message = "Indicates the requested process instance was not found.")
})
@RequestMapping(value = "/runtime/process-instances/{processInstanceId}/variables", method = RequestMethod.GET, produces = "application/json")
public List<RestVariable> getVariables(@ApiParam(name = "processInstanceId", value="The id of the process instance to the variables for.") @PathVariable String processInstanceId, @RequestParam(value = "scope", required = false) String scope, HttpServletRequest request) {

  Execution execution = getProcessInstanceFromRequest(processInstanceId);
  return processVariables(execution, scope, RestResponseFactory.VARIABLE_PROCESS);
}