Prevent Json nesting for stats
- stats are cyclic which is awful for transmitting the stats to the client Could not write JSON: Document nesting depth (1001) exceeds the maximum allowed (1000, from StreamWriteConstraints.getMaxNestingDepth())
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package SuMoC.backend.user.stats;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.*;
|
||||
|
||||
@@ -13,6 +14,7 @@ public class Stats {
|
||||
|
||||
@Schema(description = "The StatsList to which these stats belong.", required = true)
|
||||
@ManyToOne
|
||||
@JsonIgnore
|
||||
private StatsList statsList;
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.lang.reflect.Field;
|
||||
|
||||
import SuMoC.backend.gamification.Timeframe;
|
||||
import SuMoC.backend.user.models.User;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
@@ -21,6 +22,7 @@ public class StatsList {
|
||||
@OneToOne
|
||||
@MapsId
|
||||
@JoinColumn(name = "user_id")
|
||||
@JsonIgnore
|
||||
private User user;
|
||||
|
||||
@Schema(description = "Total stats of the user.")
|
||||
|
||||
Reference in New Issue
Block a user