forked from finos/vuu
-
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.
VUU-333: Add constraints to name, group, and user in BaseMetadata (fi…
…nos#991) * SLVUU-90: Add not blank constraints to name, group, and user in BaseMetadata * SLVUU: Revert aggressive auto-formatting
- Loading branch information
1 parent
3635d43
commit 3fbc182
Showing
4 changed files
with
138 additions
and
5 deletions.
There are no files selected for viewing
8 changes: 5 additions & 3 deletions
8
layout-server/src/main/java/org/finos/vuu/layoutserver/dto/request/LayoutRequestDto.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,19 +1,21 @@ | ||
package org.finos.vuu.layoutserver.dto.request; | ||
|
||
import com.fasterxml.jackson.databind.node.ObjectNode; | ||
import lombok.Data; | ||
|
||
import javax.validation.Valid; | ||
import javax.validation.constraints.NotNull; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class LayoutRequestDto { | ||
|
||
/** | ||
* The definition of the layout as an arbitrary JSON structure, describing all required components | ||
* The definition of the layout as an arbitrary JSON structure, describing all required | ||
* components | ||
*/ | ||
@NotNull(message = "Definition must not be null") | ||
private ObjectNode definition; | ||
|
||
@NotNull(message = "Metadata must not be null") | ||
@Valid | ||
private MetadataRequestDto metadata; | ||
} |
2 changes: 2 additions & 0 deletions
2
layout-server/src/main/java/org/finos/vuu/layoutserver/dto/request/MetadataRequestDto.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,12 +1,14 @@ | ||
package org.finos.vuu.layoutserver.dto.request; | ||
|
||
import com.fasterxml.jackson.annotation.JsonUnwrapped; | ||
import javax.validation.Valid; | ||
import lombok.Data; | ||
import org.finos.vuu.layoutserver.model.BaseMetadata; | ||
|
||
@Data | ||
public class MetadataRequestDto { | ||
|
||
@JsonUnwrapped | ||
@Valid | ||
BaseMetadata baseMetadata; | ||
} |
8 changes: 6 additions & 2 deletions
8
layout-server/src/main/java/org/finos/vuu/layoutserver/model/BaseMetadata.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,19 +1,23 @@ | ||
package org.finos.vuu.layoutserver.model; | ||
|
||
import lombok.Data; | ||
|
||
import javax.persistence.Embeddable; | ||
import javax.persistence.Lob; | ||
import javax.validation.constraints.NotBlank; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Embeddable | ||
public class BaseMetadata { | ||
|
||
@NotBlank(message = "Name is required") | ||
private String name; | ||
|
||
@NotBlank(message = "Group is required") | ||
private String group; | ||
|
||
@Lob | ||
private String screenshot; | ||
|
||
@NotBlank(message = "User is required") | ||
private String user; | ||
} |
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