All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.convergence_platform.common.dto.RequestValidationFieldFailureDTO Maven / Gradle / Ivy

Go to download

Holds the common functionality needed by all Convergence Platform-based services written in Java.

The newest version!
package io.convergence_platform.common.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.validation.FieldError;

import java.util.ArrayList;
import java.util.List;

public class RequestValidationFieldFailureDTO {
    @JsonProperty("field")
    public String field;

    @JsonProperty("location")
    public String location;

    @JsonProperty("error_messages")
    public List messages = new ArrayList<>();

    public RequestValidationFieldFailureDTO() {

    }

    public RequestValidationFieldFailureDTO(FieldError fieldError) {
        this.field = fieldError.getField();
        this.location = "body";
        this.messages.add(fieldError.getDefaultMessage());

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy