-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: switch to NotBlank for record Dto validation
- Loading branch information
1 parent
0b891da
commit 99b0fa6
Showing
8 changed files
with
37 additions
and
37 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/AuthDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) { } |
6 changes: 3 additions & 3 deletions
6
library-api-authentication-server/src/main/java/dev/earlspilner/auth/dto/Tokens.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters