Recursos swagger (tags)
Atualizado
Atualizado
Incluiremos anotações nos recursos (controllers)
@Tag(name = "Movies", description = "Controller for Movie")
public class MovieController {}
Resultado:
@Operation(
description = "Create a new movie",
summary = "Create a new movie",
responses = {
@ApiResponse(description = "Created", responseCode = "201"),
@ApiResponse(description = "Bad Request", responseCode = "400"),
@ApiResponse(description = "Unauthorized", responseCode = "401"),
@ApiResponse(description = "Forbidden", responseCode = "403"),
@ApiResponse(description = "Unprocessable Entity", responseCode = "422")
}
)
@PreAuthorize("hasRole('ROLE_ADMIN')")
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<MovieDTO> insert(@RequestBody MovieDTO dto) {
@GetMapping(value = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
public MovieDTO findById(@PathVariable Long id) {