diff --git a/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/AuthDto.java b/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/AuthDto.java index fb7ec13..d1c85ff 100644 --- a/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/AuthDto.java +++ b/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/AuthDto.java @@ -1,18 +1,18 @@ package dev.earlspilner.auth.dto; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.NotBlank; /** * @author Alexander Dudkin */ @Schema(description = "Authentication request data") public record AuthDto( - @NotNull + @NotBlank @Schema(description = "User's username", example = "thisdudkin", requiredMode = Schema.RequiredMode.REQUIRED) String username, - @NotNull + @NotBlank @Schema(description = "User's password", example = "password", requiredMode = Schema.RequiredMode.REQUIRED) String password ) { } diff --git a/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/Tokens.java b/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/Tokens.java index 00a55f3..179cebb 100644 --- a/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/Tokens.java +++ b/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/Tokens.java @@ -1,18 +1,18 @@ package dev.earlspilner.auth.dto; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.NotBlank; /** * @author Alexander Dudkin */ @Schema(description = "Access and refresh tokens") public record Tokens( - @NotNull + @NotBlank @Schema(description = "Access token", example = "eyJhbGciOiJIUzI1...", requiredMode = Schema.RequiredMode.REQUIRED) String accessToken, - @NotNull + @NotBlank @Schema(description = "Refresh token", example = "dXNlci1yZWZyZXNoLXRva2Vu..", requiredMode = Schema.RequiredMode.REQUIRED) String refreshToken ) { } diff --git a/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/UserDto.java b/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/UserDto.java index 7ed8a6a..4615a4d 100644 --- a/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/UserDto.java +++ b/library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/UserDto.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import jakarta.validation.constraints.Email; -import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.NotBlank; import java.util.List; @@ -14,10 +14,10 @@ @JsonInclude(NON_NULL) public record UserDto( Integer id, - @NotNull String name, - @NotNull String username, - @Email @NotNull String email, - @NotNull String password, + @NotBlank String name, + @NotBlank String username, + @Email @NotBlank String email, + @NotBlank String password, String createdUtc, String updatedUtc, List roles diff --git a/library-api-books-service/src/main/java/dev/earlspilner/books/dto/BookDto.java b/library-api-books-service/src/main/java/dev/earlspilner/books/dto/BookDto.java index 40813c4..01f06f1 100644 --- a/library-api-books-service/src/main/java/dev/earlspilner/books/dto/BookDto.java +++ b/library-api-books-service/src/main/java/dev/earlspilner/books/dto/BookDto.java @@ -1,7 +1,7 @@ package dev.earlspilner.books.dto; import com.fasterxml.jackson.annotation.JsonInclude; -import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.ISBN; import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; @@ -12,11 +12,11 @@ @JsonInclude(NON_NULL) public record BookDto( Integer id, - @ISBN @NotNull String isbn, - @NotNull String title, - @NotNull String genre, - @NotNull String description, - @NotNull String author, + @ISBN @NotBlank String isbn, + @NotBlank String title, + @NotBlank String genre, + @NotBlank String description, + @NotBlank String author, Boolean isAvailable, String appearedUtc ) { } diff --git a/library-api-books-service/src/main/java/dev/earlspilner/books/dto/UserDto.java b/library-api-books-service/src/main/java/dev/earlspilner/books/dto/UserDto.java index 77d9329..6ba6ec5 100644 --- a/library-api-books-service/src/main/java/dev/earlspilner/books/dto/UserDto.java +++ b/library-api-books-service/src/main/java/dev/earlspilner/books/dto/UserDto.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import jakarta.validation.constraints.Email; -import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.NotBlank; import java.util.List; @@ -14,10 +14,10 @@ @JsonInclude(NON_NULL) public record UserDto( Integer id, - @NotNull String name, - @NotNull String username, - @Email @NotNull String email, - @NotNull String password, + @NotBlank String name, + @NotBlank String username, + @Email @NotBlank String email, + @NotBlank String password, String createdUtc, String updatedUtc, List roles diff --git a/library-api-library-service/src/main/java/dev/earlspilner/library/dto/UserDto.java b/library-api-library-service/src/main/java/dev/earlspilner/library/dto/UserDto.java index eee7fb3..a468ff5 100644 --- a/library-api-library-service/src/main/java/dev/earlspilner/library/dto/UserDto.java +++ b/library-api-library-service/src/main/java/dev/earlspilner/library/dto/UserDto.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import jakarta.validation.constraints.Email; -import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.NotBlank; import java.util.List; @@ -14,10 +14,10 @@ @JsonInclude(NON_NULL) public record UserDto( Integer id, - @NotNull String name, - @NotNull String username, - @Email @NotNull String email, - @NotNull String password, + @NotBlank String name, + @NotBlank String username, + @Email @NotBlank String email, + @NotBlank String password, String createdUtc, String updatedUtc, List roles diff --git a/library-api-loan-service/src/main/java/dev/earlspilner/loans/dto/UserDto.java b/library-api-loan-service/src/main/java/dev/earlspilner/loans/dto/UserDto.java index e6023c4..b8b1835 100644 --- a/library-api-loan-service/src/main/java/dev/earlspilner/loans/dto/UserDto.java +++ b/library-api-loan-service/src/main/java/dev/earlspilner/loans/dto/UserDto.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import jakarta.validation.constraints.Email; -import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.NotBlank; import java.util.List; @@ -14,10 +14,10 @@ @JsonInclude(NON_NULL) public record UserDto( Integer id, - @NotNull String name, - @NotNull String username, - @Email @NotNull String email, - @NotNull String password, + @NotBlank String name, + @NotBlank String username, + @Email @NotBlank String email, + @NotBlank String password, String createdUtc, String updatedUtc, List roles diff --git a/library-api-users-service/src/main/java/dev/earlspilner/users/dto/UserDto.java b/library-api-users-service/src/main/java/dev/earlspilner/users/dto/UserDto.java index a573ba8..c8e7f2d 100644 --- a/library-api-users-service/src/main/java/dev/earlspilner/users/dto/UserDto.java +++ b/library-api-users-service/src/main/java/dev/earlspilner/users/dto/UserDto.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import dev.earlspilner.users.model.UserRole; import jakarta.validation.constraints.Email; -import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.NotBlank; import java.util.List; @@ -15,10 +15,10 @@ @JsonInclude(NON_NULL) public record UserDto( Integer id, - @NotNull String name, - @NotNull String username, - @Email @NotNull String email, - @NotNull String password, + @NotBlank String name, + @NotBlank String username, + @Email @NotBlank String email, + @NotBlank String password, String createdUtc, String updatedUtc, List roles