Skip to content

Instantly share code, notes, and snippets.

@graemerocher
Created January 28, 2022 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save graemerocher/85f9477d97d21186de6c3178f11008f6 to your computer and use it in GitHub Desktop.
Save graemerocher/85f9477d97d21186de6c3178f11008f6 to your computer and use it in GitHub Desktop.
Example Java Record with Jackson annotations
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