Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

SLVUU-90: Add constraints to name, group, and user in BaseMetadata #118

Closed
Show file tree
Hide file tree
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
@@ -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;
}
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;
}
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;
}
Loading
Loading