Skip to content

Conversation

@filiphr
Copy link
Contributor

@filiphr filiphr commented Nov 28, 2025

Use methods from HttpHeaders which are available both from Spring 6 and Spring 7 Make sure that the entire Spring AI compiles with Spring 7

This PR is the same as #4817 which was closed due to PR #4774 which added Spring Boot 4.x compatibility to main. However, it would be good if Spring AI 1.1.x would do a best effort to be able to be used with Spring 7. The reason why I am asking this is due to the fact that we are using Spring AI, but we have also migrated to Spring Boot 4 and Spring 7. In order to achieve this we've had to copy the spring-ai-openai and spring-ai-anthropic modules and do the adjustments that are done in this PR. It would be great if this comes out-of-the-box from Spring AI itself and we can remove our copy.

Thank you in advance for considering the PR

Use methods from HttpHeaders which are available both from Spring 6 and Spring 7
Make sure that the entire Spring AI compiles with Spring 7

* Add GitHub Worklfow that runs the suite with Spring 7
* Uncomment `@Override` from methods implementing from ResponseHandler
* Add custom ApiClient.mustache, original copied from https://github.com/swagger-api/swagger-codegen/blob/92fcc8196bd90fef199c2932903135e3b519f689/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache and adjusted the use of the HttpHeaders to be compliant with Spring 7
* Adjust ChatCLientExtensions.kt to be compatible with Kotlin 2

Signed-off-by: Filip Hrisafov <filip.hrisafov@gmail.com>
@ilayaperumalg
Copy link
Member

@filiphr Thanks very much for the PR and the details.

I agree on the proposed compatibility on Spring Framework at the best level basis. I will bring this up with the team and update.
On the first look, the changes look good as well.

@ilayaperumalg ilayaperumalg self-assigned this Nov 28, 2025
@ilayaperumalg
Copy link
Member

@filiphr Please be aware that our community should not get a false impression that Spring AI 1.1.x supports Spring Framework 7.x as we know, this compatibility might get broken anytime with any potential breaking changes in the code.

Spring AI 2.x should be the only Spring Framework 7.x compatible/reliable option going forward.

I will update the team consensus on this on Monday.

@filiphr
Copy link
Contributor Author

filiphr commented Nov 28, 2025

Please be aware that our community should not get a false impression that Spring AI 1.1.x supports Spring Framework 7.x as we know, this compatibility might get broken anytime with any potential breaking changes in the code.

I 100% agree with you here @ilayaperumalg. It's only a best effort, there are no guarantees that it works or anything like that.

Spring AI 2.x should be the only Spring Framework 7.x compatible/reliable option going forward.

Our plan is to upgrade to Spring AI 2.x as soon as it becomes available.

@ilayaperumalg
Copy link
Member

@filiphr Would you be fine with 2.0.0-M1 when it gets released instead of merging this PR?

@filiphr
Copy link
Contributor Author

filiphr commented Dec 2, 2025

I doubt that we are going to go with 2.0.0-M1 now, we are doing our own release a week after your release, so it will be a big tight.

May I ask what the reason for not merging this to 1.1 would be? Are you concerned about something in particular?

@ilayaperumalg ilayaperumalg added this to the 1.1.1 milestone Dec 2, 2025
@ilayaperumalg ilayaperumalg removed this from the 1.1.1 milestone Dec 2, 2025
@ilayaperumalg
Copy link
Member

@filiphr We have decided not to go ahead with the PR for the following reasons:

  • This gives a false hope to the community that there is some support for Spring Framework 7 from Spring AI 1.1.1.
  • Even though your PR addresses the current breaking changes, we would be obligated to address any future PRs with any breaking changes from the community by accepting this PR.
  • We want to make sure the community switches to the official Spring AI version 2.0 once it is available for the Spring Framework 7 and Spring Boot 4.0 compatibility.

Sorry for the inconvenience and thanks again for the continued support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants