Skip to content

Jackson

EasyYapi supports Jackson annotations for JSON serialization customization.

Supported Annotations

Field Name

  • @JsonProperty — Custom field name
  • @JsonNaming — Naming strategy

Field Ignore

  • @JsonIgnore — Ignore a field
  • @JsonIgnoreProperties — Ignore multiple fields

Type Handling

  • @JsonFormat — Date/time format
  • @JsonDeserialize / @JsonSerialize — Custom serializer

Inclusion

  • @JsonInclude — Include strategy

Example

java
public class User {

    @JsonProperty("user_name")
    private String name;

    @JsonIgnore
    private String password;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String nickname;
}

Configuration

Use the following rules to customize Jackson integration:

Released under the Apache-2.0 License.