How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Jackson in Spring Boot: Serialize a flat Map (adjacency list) into a nested JSON tree without intermediate objects [closed]

calendar_today May 27, 2026 person JOSUE RAFAEL PEREZ AGUIRRE domain spring-boot

I am building a Spring Boot REST API where a strict architectural constraint requires me to implement and expose a tree data structure using only standard Java Collections (e.g., Map, List). I am explicitly forbidden from creating custom Node, Tree, or intermediate DTO classes for this specific engine implementation. The OpenAPI contract expects a deeply nested JSON response, but my tree is maintained in memory as flat maps.

open_in_new Read original post