spring-projects / spring-projects/spring-ai

Add TOON (Token-Oriented Object Notation) Support

Open
#4,869 2 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

Expected Behavior

Spring AI should support the TOON format as a serialization option when sending structured data to LLM models.

Example usage:

ExampleObject exampleObject = new ExampleObject();

String response = chatClient.prompt()
    .mapper(toonMapper) // <-- the TOON mapper bean
    .user(exampleObject)
    .call()
    .content();

This would allow applications to use TOON instead of JSON/YAML for model inputs, improving efficiency and reducing token count.

Current Behavior

Spring AI currently supports JSON and YAML (via built-in or user-provided serializers), but there’s no native TOON support.
Developers must manually serialize/deserialize TOON data and integrate it into prompts or function-calling logic.

Context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files, tests, or an existing entry point; start by locating Spring AI's JSON/YAML serialization integration and prompt mapper support. Review the referenced TOON libraries and define the module boundaries and compatibility expectations before implementation. Done means applications can use native TOON serialization and deserialization for structured model inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.