Skip to content

Commit 180da5b

Browse files
committed
Add README.md to document FasterXML Jackson Examples project
1 parent 90dd4dc commit 180da5b

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# FasterXML Jackson Examples
2+
3+
This project demonstrates various FasterXML Jackson annotations in a Spring Boot application. It showcases common JSON serialization and deserialization scenarios using Jackson annotations.
4+
5+
## Features
6+
7+
The project includes examples of the following Jackson annotations:
8+
9+
1. **Basic JSON Serialization** (`/hello`)
10+
- Simple example of JSON response using Spring RestController
11+
12+
2. **@JsonIgnore** (`/jsonIgnore`)
13+
- Demonstrates how to exclude fields from JSON serialization
14+
- Example shows a field marked with `@JsonIgnore` being excluded from the response
15+
16+
3. **@JsonProperty** (`/jsonProperty`)
17+
- Shows how to customize field names in JSON output
18+
- Converts camelCase Java field names to snake_case JSON properties
19+
20+
4. **@JsonInclude** (`/jsonInclude`)
21+
- Demonstrates how to control which fields are included in JSON output
22+
- Example shows excluding null fields from the response
23+
24+
## Requirements
25+
26+
- Java 21
27+
- Spring Boot 3.4.5
28+
29+
## Running the Application
30+
31+
You can run the application using the Maven wrapper:
32+
33+
```bash
34+
./mvnw spring-boot:run
35+
```
36+
37+
## Testing
38+
39+
To run the tests:
40+
41+
```bash
42+
./mvnw test
43+
```
44+
45+
## Endpoints
46+
47+
1. `GET /hello` - Returns a simple JSON message
48+
2. `GET /jsonIgnore` - Demonstrates @JsonIgnore annotation
49+
3. `GET /jsonProperty` - Shows @JsonProperty annotation usage
50+
4. `GET /jsonInclude` - Demonstrates @JsonInclude annotation
51+
52+
## Technologies Used
53+
54+
- Spring Boot
55+
- FasterXML Jackson
56+
- JUnit 5
57+
- Spring Test

0 commit comments

Comments
 (0)