Skip to content

Commit 198c69f

Browse files
author
Carmine DiMascio
committed
update readme
1 parent 1f3f551 commit 198c69f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Customizable errors for RESTful and HTTP services.
88
<img src="https://raw.githubusercontent.com/cdimascio/japi-errors/master/assets/japi-errors.png" width="600">
99
</p>
1010

11-
All errors are Jackson ready and can be serialized as *JSON*, *XML*, and *YAML*.
12-
1311
Out of the box, **japi-errors** provides [two error formats](#configure) or enables you to [provide](#customize) your own.
1412

13+
All 'out of the box' errors are Jackson ready and can be serialized as *JSON*, *XML*, and *YAML*. If you'd like to use GSON or something else, [create a custom error creator](#customize).
14+
1515
## Install
1616

1717
Gradle
@@ -52,6 +52,8 @@ Assign
5252
AbstractApiError error = unauthorized();
5353
```
5454

55+
See [examples](#examples) with Spring MVC
56+
5557
## Configure
5658

5759
japi-errors supports two error formats "out of the box". They are enabled as follows:
@@ -107,6 +109,7 @@ public class MyApiErrorCreator implements IApiErrorCreator {
107109

108110
```java
109111
// Create a custom api error object
112+
// Add Json ignore properties (see source code link above)
110113
public class MyApiError extends ApiError {
111114
@JsonProperty
112115
private String message;
@@ -120,10 +123,16 @@ public class MyApiError extends ApiError {
120123
}
121124

122125
public String getMessage() {
123-
return message
126+
return message;
124127
}
125128
}
126129
```
127130

131+
## Examples
132+
133+
Check out the following examples to see **japi-errors** in use:
134+
135+
- with [Spring MVC](https://github.com/cdimascio/kotlin-spring-mvc-template/blob/master/src/main/kotlin/api/users/UsersController.kt#L38)
136+
128137
## License
129138
[Apache 2](LICENSE)

0 commit comments

Comments
 (0)