Skip to content

Commit 613b8af

Browse files
authored
Merge pull request aol#246 from tonyfinn/json_annotations_for_error_code
Add JsonProperty annotations to ErrorCode constructor.
2 parents f2574e4 + 4b8bd27 commit 613b8af

File tree

1 file changed

+4
-1
lines changed
  • micro-error-codes/src/main/java/com/aol/micro/server/errors

1 file changed

+4
-1
lines changed

micro-error-codes/src/main/java/com/aol/micro/server/errors/ErrorCode.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.text.MessageFormat;
44

5+
import com.fasterxml.jackson.annotation.JsonProperty;
56
import lombok.Getter;
67

78
@Getter
@@ -36,7 +37,9 @@ public static ErrorCode critical(final int errorId, final String message) {
3637
errorId, message, Severity.CRITICAL);
3738
}
3839

39-
private ErrorCode(final int errorId, final String message, final Severity severity) {
40+
private ErrorCode(@JsonProperty("errorId") final int errorId,
41+
@JsonProperty("message") final String message,
42+
@JsonProperty("severity") final Severity severity) {
4043

4144
this.errorId = errorId;
4245
this.message = message;

0 commit comments

Comments
 (0)