<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/spring-ai-tutorial-06---structured-output-gklqi7jof" -->

---
title: Spring AI Tutorial : 06 - Structured Output | daily.dev
description: A tutorial episode in a Spring AI series demonstrates how to get structured, typed responses from LLMs instead of raw text using Spring AI's output converters....
canonical: https://daily.dev/posts/spring-ai-tutorial-06---structured-output-gklqi7jof
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Spring AI Tutorial : 06 - Structured Output | daily.dev
og:description: A tutorial episode in a Spring AI series demonstrates how to get structured, typed responses from LLMs instead of raw text using Spring AI's output converters....
og:url: https://daily.dev/posts/spring-ai-tutorial-06---structured-output-gklqi7jof
og:image: https://api.daily.dev/og/posts/gKLQi7JOf.png
og:image:alt: Spring AI Tutorial : 06 - Structured Output
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Spring AI Tutorial : 06 - Structured Output

**[SivaLabs \(YouTube\)](https://daily.dev/sources/sivalabs-youtube)** · 13 min read · 0 upvotes · 0 comments

## Summary

A tutorial episode in a Spring AI series demonstrates how to get structured, typed responses from LLMs instead of raw text using Spring AI's output converters. It covers ListOutputConverter (returning a list of strings for title suggestions), MapOutputConverter (returning programming languages mapped to inception years), and BeanOutputConverter (returning a Java record/object like a Tweet with content and hashtags). The walkthrough inspects the logging advisor output to show exactly how Spring AI augments the prompt behind the scenes—appending format instructions or a full JSON schema—so developers don't have to manually parse LLM text responses into typed data.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=MpTNOhJ_Jjk>

## Questions this post answers

### How do I get a Java object instead of plain text back from an LLM call in Spring AI?

Use Spring AI's BeanOutputConverter, passing the target type (for example a Tweet record with a content string and a hashtags list). Call converter.getFormat() and append it to the prompt template, then after invoking the LLM call converter.convert() on the raw text response to parse it into the typed object. Spring AI automatically appends a JSON schema describing the object's properties to the prompt so the model returns matching JSON.

_Developers wiring LLM responses into typed Java objects can find more Spring AI patterns like this on daily.dev._

### What is the difference between ListOutputConverter and MapOutputConverter in Spring AI?

ListOutputConverter parses an LLM's response into a list of strings, useful for cases like generating multiple title suggestions, and it instructs the model to respond with comma-separated values. MapOutputConverter parses the response into a Java util HashMap, useful for key-value data like programming languages mapped to their inception years, and it instructs the model to return RFC 8259 compliant JSON matching that structure.

_Teams choosing the right output converter for their LLM integration can track more Spring AI comparisons on daily.dev._

## Similar posts on daily.dev

- [Spring AI : Structured Output](https://daily.dev/posts/spring-ai-structured-output-vawtiuqjk) · SivaLabs · 4 upvotes · 1 comments
- [A Guide to Structured Output in Spring AI](https://daily.dev/posts/a-guide-to-structured-output-in-spring-ai-fhz21l4ic) · Baeldung · 1 upvotes · 0 comments
- [Spring AI tutorial: Get started with Spring AI](https://daily.dev/posts/spring-ai-tutorial-get-started-with-spring-ai-phjfbwkwg) · InfoWorld · 0 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#java](https://daily.dev/tags/java), [#prompt-engineering](https://daily.dev/tags/prompt-engineering), [#spring-ai](https://daily.dev/tags/spring-ai)

[View this post on daily.dev](https://daily.dev/posts/spring-ai-tutorial-06---structured-output-gklqi7jof)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Spring AI Tutorial : 06 - Structured Output","url":"https://daily.dev/posts/spring-ai-tutorial-06---structured-output-gklqi7jof","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/spring-ai-tutorial-06---structured-output-gklqi7jof"},"datePublished":"2026-09-27T07:26:38.334Z","dateModified":"2026-10-15T02:22:40.138Z","description":"A tutorial episode in a Spring AI series demonstrates how to get structured, typed responses from LLMs instead of raw text using Spring AI's output converters....","image":"https://i.ytimg.com/vi/MpTNOhJ_Jjk/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/MpTNOhJ_Jjk/sddefault.jpg","isAccessibleForFree":true,"articleSection":"SivaLabs (YouTube)","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"SivaLabs (YouTube)","logo":"https://media.daily.dev/image/upload/s--8ATVo4an--/f_auto,q_auto/v1790493987/logos/sivalabs-youtube?_a=BAMAMicg0","url":"https://daily.dev/sources/sivalabs-youtube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/spring-ai-tutorial-06---structured-output-gklqi7jof","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,java,prompt-engineering,spring-ai","timeRequired":"PT13M","video":{"@type":"VideoObject","name":"Spring AI Tutorial : 06 - Structured Output","description":"A tutorial episode in a Spring AI series demonstrates how to get structured, typed responses from LLMs instead of raw text using Spring AI's output converters....","thumbnailUrl":"https://i.ytimg.com/vi/MpTNOhJ_Jjk/sddefault.jpg","uploadDate":"2026-09-27T07:26:38.334Z","duration":"PT13M","url":"https://api.daily.dev/r/gKLQi7JOf","embedUrl":"https://www.youtube.com/embed/MpTNOhJ_Jjk"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"SivaLabs (YouTube)","item":"https://daily.dev/sources/sivalabs-youtube"},{"@type":"ListItem","position":3,"name":"Spring AI Tutorial : 06 - Structured Output"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/spring-ai-tutorial-06---structured-output-gklqi7jof#faq","mainEntity":[{"@type":"Question","name":"How do I get a Java object instead of plain text back from an LLM call in Spring AI?","acceptedAnswer":{"@type":"Answer","text":"Use Spring AI's BeanOutputConverter, passing the target type (for example a Tweet record with a content string and a hashtags list). Call converter.getFormat() and append it to the prompt template, then after invoking the LLM call converter.convert() on the raw text response to parse it into the typed object. Spring AI automatically appends a JSON schema describing the object's properties to the prompt so the model returns matching JSON. Developers wiring LLM responses into typed Java objects can find more Spring AI patterns like this on daily.dev."}},{"@type":"Question","name":"What is the difference between ListOutputConverter and MapOutputConverter in Spring AI?","acceptedAnswer":{"@type":"Answer","text":"ListOutputConverter parses an LLM's response into a list of strings, useful for cases like generating multiple title suggestions, and it instructs the model to respond with comma-separated values. MapOutputConverter parses the response into a Java util HashMap, useful for key-value data like programming languages mapped to their inception years, and it instructs the model to return RFC 8259 compliant JSON matching that structure. Teams choosing the right output converter for their LLM integration can track more Spring AI comparisons on daily.dev."}}]}
```

