Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make VaultDto ID non-nullable. #319

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ public Response claimOwnership(@PathParam("vaultId") UUID vaultId, @FormParam("p
}


public record VaultDto(@JsonProperty("id") UUID id,
public record VaultDto(@JsonProperty("id") @NotBlank UUID id,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Replace @NotBlank with @NotNull for UUID field.

The @NotBlank annotation is designed for String fields to ensure they contain at least one non-whitespace character. For UUID fields, @NotNull is more appropriate as it ensures the field is not null without attempting to check for blank characters.

Apply this diff to fix the annotation:

-  public record VaultDto(@JsonProperty("id") @NotBlank UUID id,
+  public record VaultDto(@JsonProperty("id") @NotNull UUID id,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public record VaultDto(@JsonProperty("id") @NotBlank UUID id,
public record VaultDto(@JsonProperty("id") @NotNull UUID id,

@JsonProperty("name") @NoHtmlOrScriptChars @NotBlank String name,
@JsonProperty("description") @NoHtmlOrScriptChars String description,
@JsonProperty("archived") boolean archived,
Expand Down