From 70f905082cf95ca44ad9ce742d3ca9e1b928652b Mon Sep 17 00:00:00 2001 From: masoudarvishian Date: Fri, 10 May 2024 12:00:32 +0200 Subject: [PATCH] Added Swagger for the REST APIs --- build.gradle | 1 + .../java/com/zenjob/challenge/controller/JobController.java | 2 +- .../java/com/zenjob/challenge/controller/ShiftController.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index aae28df..de2cfee 100644 --- a/build.gradle +++ b/build.gradle @@ -25,6 +25,7 @@ dependencies { implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-aop' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web' + implementation 'org.springdoc:springdoc-openapi-ui:1.8.0' compile group: 'org.springframework.boot', name: 'spring-boot-starter-aop' compile group: 'io.micrometer', name: 'micrometer-registry-prometheus' compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa' diff --git a/src/main/java/com/zenjob/challenge/controller/JobController.java b/src/main/java/com/zenjob/challenge/controller/JobController.java index 182ef7e..f3b4edb 100644 --- a/src/main/java/com/zenjob/challenge/controller/JobController.java +++ b/src/main/java/com/zenjob/challenge/controller/JobController.java @@ -18,7 +18,7 @@ import java.time.LocalDate; import java.util.UUID; -@Controller +@RestController @RequestMapping(path = "/job") @RequiredArgsConstructor public class JobController { diff --git a/src/main/java/com/zenjob/challenge/controller/ShiftController.java b/src/main/java/com/zenjob/challenge/controller/ShiftController.java index 504c106..de594e2 100644 --- a/src/main/java/com/zenjob/challenge/controller/ShiftController.java +++ b/src/main/java/com/zenjob/challenge/controller/ShiftController.java @@ -16,7 +16,7 @@ import java.util.UUID; import java.util.stream.Collectors; -@Controller +@RestController @RequestMapping(path = "/shift") @RequiredArgsConstructor public class ShiftController {