Leveling Up: Returning JSON in my first Spring Boot REST API



This content originally appeared on DEV Community and was authored by Aizen

After creating my first /hello endpoint in Spring Boot, I wanted to make it more “real-world.” Plain text is fine for learning, but production APIs usually return structured JSON. Today, I built that!

What I did

1.Created a simple response class to hold my data:

2.Updated my controller to return this object:

3.output


This content originally appeared on DEV Community and was authored by Aizen