diff --git a/src/main/java/no/ndla/taxonomy/service/dtos/NodeDTO.java b/src/main/java/no/ndla/taxonomy/service/dtos/NodeDTO.java index cbb4bb9c..a4057549 100644 --- a/src/main/java/no/ndla/taxonomy/service/dtos/NodeDTO.java +++ b/src/main/java/no/ndla/taxonomy/service/dtos/NodeDTO.java @@ -79,6 +79,10 @@ public class NodeDTO { @Schema(description = "A list of all contexts this node is part of") private List contexts = new ArrayList<>(); + @JsonProperty + @Schema(description = "A list of all contextids this node has ever had") + private Set contextids = new HashSet<>(); + @JsonProperty @Schema(description = "The context object selected when fetching node") private Optional context = Optional.empty(); @@ -144,6 +148,7 @@ public NodeDTO( .collect(Collectors.toCollection(TreeSet::new)); this.nodeType = entity.getNodeType(); + this.contextids = entity.getContextIds(); Optional selected = entity.pickContext(contextId, parent, root, filteredContexts); selected.ifPresent(ctx -> {