-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Bug description
When migrating Spring AI from version 1.0.0-M8 to 1.0.0, configuring the spring.ai.azure.openai.chat.options.response-format property with values such as text, json_object, or json_schema (which were changed from the previous json value) results in an application startup failure. The application fails to bind the string property value to the org.springframework.ai.azure.openai.AzureOpenAiResponseFormat type, throwing a ConverterNotFoundException.
Environment
- Spring AI version:
1.0.0(migrating from1.0.0-M8) - Java version: 21
- Model Provider: Azure OpenAI
Steps to reproduce
- Have a Spring Boot application using
spring-ai-azure-openai-starter. - Previously, in version
1.0.0-M8or earlier, have the propertyspring.ai.azure.openai.chat.options.responseFormat=json(or its equivalent) configured. - Upgrade the Spring AI version to
1.0.0. - Modify the configuration property to
spring.ai.azure.openai.chat.options.response-formatand set its value to one of the new supported formats, for example:spring.ai.azure.openai.chat.options.response-format=json_object. - Attempt to start the Spring Boot application.
- Observe the
APPLICATION FAILED TO STARTerror with theConverterNotFoundException.
Expected behavior
The application should start successfully with the spring.ai.azure.openai.chat.options.response-format property correctly bound to the AzureOpenAiResponseFormat type, allowing the Azure OpenAI chat client to use the specified response format (e.g., text, json_object, or json_schema).
Minimal Complete Reproducible example
A minimal complete reproducible example or failing test was not provided in the initial report. However, a simple Spring Boot application with the spring-ai-azure-openai-starter dependency and the following configuration in application.properties should trigger the issue:
application.properties:
spring.ai.azure.openai.api-key=<YOUR_AZURE_OPENAI_KEY>
spring.ai.azure.openai.endpoint=<YOUR_AZURE_OPENAI_ENDPOINT>
spring.ai.azure.openai.chat.options.deployment-name=<YOUR_DEPLOYMENT_NAME> # or model
spring.ai.azure.openai.chat.options.response-format=json_object # or text, or json_schemaA simple component attempting to use the ChatClient would be sufficient to trigger the context loading and property binding.
Error Log Snippet Provided:
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'spring.ai.azure.openai.chat.options.response-format' to org.springframework.ai.azure.openai.AzureOpenAiResponseFormat:
Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [@com.fasterxml.jackson.annotation.JsonProperty org.springframework.ai.azure.openai.AzureOpenAiResponseFormat]
Action:
Review the value of the property. If the problem persists, check the DDL definition of the an @ConfigurationProperties bean if you have one.