Skip to content

Commit

Permalink
[INJIMOB-2260] revert responseWrapper change with manual setters (#501)
Browse files Browse the repository at this point in the history
Signed-off-by: KiruthikaJeyashankar <[email protected]>
  • Loading branch information
KiruthikaJeyashankar authored Nov 4, 2024
1 parent 68ac3fe commit 8d1fea2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
21 changes: 7 additions & 14 deletions src/main/java/io/mosip/mimoto/core/http/ResponseWrapper.java
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
package io.mosip.mimoto.core.http;

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

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import io.mosip.mimoto.dto.ErrorDTO;
import lombok.*;
import lombok.Data;
import lombok.NoArgsConstructor;

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

@Data
@NoArgsConstructor
public class ResponseWrapper<T> {
@NotNull
@Valid
private T response;
private List<ErrorDTO> errors = new ArrayList<>();

public void setResponse(T response) {
this.response = response;
this.errors = null;
}

public void setErrors(List<ErrorDTO> errors) {
this.errors = errors;
this.response = null;
}
}
2 changes: 1 addition & 1 deletion src/test/resources/responses/InjiConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"vcDownloadPoolInterval": "6000",
"issuer": "residentapp"
},
"errors": null
"errors": []
}

0 comments on commit 8d1fea2

Please sign in to comment.