-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
maksim.murujev
committed
Sep 24, 2024
1 parent
28a2c15
commit 829fb92
Showing
6 changed files
with
128 additions
and
11 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/main/java/com/crowdin/client/core/http/exceptions/HttpBatchBadRequestException.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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.crowdin.client.core.http.exceptions; | ||
|
||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
import java.io.Serializable; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
@EqualsAndHashCode(callSuper = true) | ||
@Data | ||
public class HttpBatchBadRequestException extends CrowdinApiException{ | ||
private final List<BatchErrors> errors; | ||
|
||
public HttpBatchBadRequestException() { | ||
this.errors = Collections.emptyList(); | ||
} | ||
|
||
@Data | ||
public static class BatchErrors implements Serializable { | ||
private Integer index; | ||
private List<ErrorHolder> errors; | ||
|
||
} | ||
|
||
@Data | ||
public static class ErrorHolder { | ||
private ErrorKey error; | ||
} | ||
|
||
@Data | ||
public static class ErrorKey implements Serializable { | ||
private String key; | ||
private List<Error> errors; | ||
} | ||
|
||
@Data | ||
public static class Error { | ||
private String code; | ||
private String message; | ||
} | ||
} |
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
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
1 change: 1 addition & 0 deletions
1
src/test/java/com/crowdin/client/sourcestrings/SourceStringsApiTest.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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"index": 0, | ||
"errors": [ | ||
{ | ||
"error": { | ||
"key": "identifier", | ||
"errors": [ | ||
{ | ||
"code": "notUnique", | ||
"message": "Invalid identifier given. Identifier must be unique" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"index": 2, | ||
"errors": [ | ||
{ | ||
"error": { | ||
"key": "identifier", | ||
"errors": [ | ||
{ | ||
"code": "notUnique", | ||
"message": "Invalid identifier given. Identifier must be unique" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
src/test/resources/api/strings/stringBatchOperationsErrorRequest.json
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[ | ||
{ | ||
"op": "add", | ||
"path": "/-", | ||
"value": { | ||
"text": "new added string", | ||
"identifier": "a.b.c", | ||
"context": "context for new string", | ||
"fileId": 5, | ||
"isHidden": false | ||
} | ||
}, | ||
{ | ||
"op": "remove", | ||
"path": "/2815" | ||
}, | ||
{ | ||
"op": "add", | ||
"path": "/-", | ||
"value": { | ||
"text": "new added string", | ||
"identifier": "a.b.c", | ||
"context": "context for new string", | ||
"fileId": 5, | ||
"isHidden": false | ||
} | ||
} | ||
] |