Prevent Json nesting for stats
LocationBasedServices/sumoc-backend/pipeline/pr-main Build queued...
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good

- 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:
Elias Harb
2026-02-01 00:52:55 +01:00
parent 5e16591913
commit e68e163214
2 changed files with 4 additions and 0 deletions
@@ -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.")