diff --git a/pom.xml b/pom.xml
index 00039f7..e0bf121 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,6 @@
org.springframework.boot
spring-boot-starter-web
-
org.springframework.boot
spring-boot-devtools
@@ -47,6 +46,17 @@
spring-boot-starter-test
test
+
+
+
+
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ 2.5.0
+
+
+
+
diff --git a/src/main/java/com/example/rest/DTO/ProjectDTO.java b/src/main/java/com/example/rest/DTO/ProjectDTO.java
index c6865db..63238f5 100644
--- a/src/main/java/com/example/rest/DTO/ProjectDTO.java
+++ b/src/main/java/com/example/rest/DTO/ProjectDTO.java
@@ -6,7 +6,7 @@
@Component
public class ProjectDTO {
private String name;
- private String description;gi
+ private String description;
public ProjectDTO() {
}
diff --git a/src/main/java/com/example/rest/Exceptions/ApiException.java b/src/main/java/com/example/rest/Exceptions/ApiException.java
new file mode 100644
index 0000000..f7eceef
--- /dev/null
+++ b/src/main/java/com/example/rest/Exceptions/ApiException.java
@@ -0,0 +1,35 @@
+package com.example.rest.Exceptions;
+
+import org.springframework.http.HttpStatus;
+
+import java.time.ZonedDateTime;
+
+public class ApiException {
+ private final String message;
+ private final Throwable throwable;
+ private final HttpStatus httpStatus;
+ private final ZonedDateTime timestamp;
+
+ public ApiException(String message, Throwable throwable, HttpStatus httpStatus, ZonedDateTime timestamp) {
+ this.message = message;
+ this.throwable = throwable;
+ this.httpStatus = httpStatus;
+ this.timestamp = timestamp;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public Throwable getThrowable() {
+ return throwable;
+ }
+
+ public HttpStatus getHttpStatus() {
+ return httpStatus;
+ }
+
+ public ZonedDateTime getTimestamp() {
+ return timestamp;
+ }
+}
diff --git a/src/main/java/com/example/rest/Exceptions/ApiExceptionHandler.java b/src/main/java/com/example/rest/Exceptions/ApiExceptionHandler.java
new file mode 100644
index 0000000..fd2f1e1
--- /dev/null
+++ b/src/main/java/com/example/rest/Exceptions/ApiExceptionHandler.java
@@ -0,0 +1,20 @@
+package com.example.rest.Exceptions;
+
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+
+@ControllerAdvice
+public class ApiExceptionHandler {
+
+ @ExceptionHandler(value = {ApiRequestException.class})
+ public ResponseEntity