Skip to content

Commit 01bed88

Browse files
committed
Update README.md
1 parent 49ade8d commit 01bed88

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
[![Build Status](https://github.com/Subhransu-De/FasterXML-Jackson-Examples/actions/workflows/pipeline.yml/badge.svg?branch=main)](https://github.com/Subhransu-De/FasterXML-Jackson-Examples/actions/workflows/pipeline.yml)
2+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Subhransu-De_FasterXML-Jackson-Examples&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Subhransu-De_FasterXML-Jackson-Examples)
3+
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Subhransu-De_FasterXML-Jackson-Examples&metric=bugs)](https://sonarcloud.io/summary/new_code?id=Subhransu-De_FasterXML-Jackson-Examples)
4+
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Subhransu-De_FasterXML-Jackson-Examples&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=Subhransu-De_FasterXML-Jackson-Examples)
5+
16
# FasterXML Jackson Examples
27

38
This project demonstrates various FasterXML Jackson annotations in a Spring Boot application. It showcases common JSON
@@ -22,6 +27,26 @@ The project includes examples of the following Jackson annotations:
2227
- Demonstrates how to control which fields are included in JSON output
2328
- Example shows excluding null fields from the response
2429

30+
5. **@JsonFormat** (`/json-format`)
31+
- Shows how to format fields like dates during serialization
32+
- Example demonstrates formatting dates with specific patterns and timezones
33+
34+
6. **@JsonUnwrapped** (`/json-unwrapped`)
35+
- Demonstrates how to flatten nested objects during serialization
36+
- Example shows unwrapping an `Address` object into the main JSON structure
37+
38+
7. **@JsonAnyGetter and @JsonAnySetter** (`/json-any-getter-setter`)
39+
- Shows how to handle arbitrary key-value pairs during serialization and deserialization
40+
- Example demonstrates serializing a map into top-level properties and deserializing unknown properties into a map
41+
42+
8. **@JsonTypeInfo and @JsonSubTypes** (`/json-type`)
43+
- Demonstrates handling polymorphic types during serialization and deserialization
44+
- Example shows serializing and deserializing different `Device` subtypes (`Laptop`, `Desktop`) based on a `type` field
45+
46+
9. **@JsonSerialize** (`/json-serialize`)
47+
- Shows how to use a custom serializer for a specific type
48+
- Example demonstrates using a `GreetingSerializer` to customize the JSON output
49+
2550
## Requirements
2651

2752
- Java 21
@@ -49,6 +74,11 @@ To run the tests:
4974
2. `GET /json-ignore` - Demonstrates @JsonIgnore annotation
5075
3. `GET /json-property` - Shows @JsonProperty annotation usage
5176
4. `GET /json-include` - Demonstrates @JsonInclude annotation
77+
5. `GET /json-format` - Demonstrates @JsonFormat annotation
78+
6. `GET /json-unwrapped` - Demonstrates @JsonUnwrapped annotation
79+
7. `POST /json-any-getter-setter` - Demonstrates @JsonAnyGetter and @JsonAnySetter annotations
80+
8. `POST /json-type` - Demonstrates @JsonTypeInfo and @JsonSubTypes annotations
81+
9. `POST /json-serialize` - Demonstrates @JsonSerialize with a custom serializer
5282

5383
## Technologies Used
5484

0 commit comments

Comments
 (0)