saw303/gradle-java-rest-api

Generate @ResponseStatus annotations for resource methods and Spring

Closed this issue · 0 comments

@RequestMapping(
      method = RequestMethod.POST,
      produces = MediaType.APPLICATION_JSON_VALUE
  )
  @ResponseBody
  @ResponseStatus(code = HttpStatus.CREATED)
  public IdType createEntity(@Valid @RequestBody RootPostResourceModel model) {
    return handleCreateEntity(model);
  }

GET

  • 200 OK (Default behaviour, no action needed)

POST

  • 201 CREATED

PUT

  • 200 OK (Default behaviour, no action needed)

DELETE

  • 204 NO CONTENT