adamsaghy commented on code in PR #4963:
URL: https://github.com/apache/fineract/pull/4963#discussion_r2284519918


##########
fineract-core/src/main/java/org/apache/fineract/infrastructure/businessdate/data/api/BusinessDateUpdateRequest.java:
##########
@@ -42,8 +44,10 @@ public class BusinessDateUpdateRequest implements 
Serializable {
 
     @NotBlank(message = 
"{org.apache.fineract.businessdate.date-format.not-blank}")
     private String dateFormat;
-    @NotNull(message = "{org.apache.fineract.businessdate.type.not-null}")
-    private BusinessDateType type;
+    @Schema(description = "Type of business date", example = "BUSINESS_DATE", 
allowableValues = { "BUSINESS_DATE", "COB_DATE" })
+    @EnumValue(enumClass = BusinessDateType.class, message = 
"{org.apache.fineract.businessdate.type.invalid}")
+    @NotNull(message = "{org.apache.fineract.businessdate.type.not-blank}")
+    private String type;

Review Comment:
   If it's an enum, but no values were provided then we got JSON parsing error, 
but what we need is validation error. It is more resilient this way.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to