-
-
Save graemerocher/85f9477d97d21186de6c3178f11008f6 to your computer and use it in GitHub Desktop.
Example Java Record with Jackson annotations
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
package example; | |
import com.fasterxml.jackson.annotation.JsonClassDescription; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
@JsonClassDescription | |
public record Book( | |
String title, | |
@JsonProperty(defaultValue="10") | |
int pages) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment