Open paolinux79 opened 8 years ago
Currently I am using spring validation group in order to keep just one dto for both object creation and update. An example follows:
@NotNull(groups = UpdateObject.class) @Getter @Setter private Integer id; @NotNull(groups = CreateObject.class) @Max(groups = {CreateObject.class, UpdateObject.class}, value = 3L) @Getter @Setter private Integer typeId; @NotNull(groups = CreateObject.class) @NotBlank @Length(min=10) @Getter @Setter private String title;
Thie typeId code is rendered by jsondoc with Format: may not be null, must be less than or equal to 3 regardless the two different group used.
Format: may not be null, must be less than or equal to 3
Maybe something like this:
Format: CreateObject: may not be null, must be less than or equal to 3 UpdateObject: must be less than or equal to 3
would be very nice!
See #171
Currently I am using spring validation group in order to keep just one dto for both object creation and update. An example follows:
Thie typeId code is rendered by jsondoc with
Format: may not be null, must be less than or equal to 3
regardless the two different group used.Maybe something like this:
would be very nice!