Annotation Interface JsonApiId
Marks a field or method as the source of the JSON:API resource identifier.
This annotation can be applied to fields or getter methods to explicitly specify which
property should be used as the id member of a JSON:API resource object. The annotated
field or method return value will be serialized as the resource's id.
If this annotation is not present, the JSON:API for Spring HATEOASrary will fall back to:
- JPA
@Idannotation (if present) - A field named "id"
Example usage:
public class Movie {
@JsonApiId
private String movieIdentifier;
// or on getter:
@JsonApiId
public String getMovieIdentifier() {
return movieIdentifier;
}
}
- See Also: