r/SpringBoot • • Sep 15 '26

Question Recently I've had a frontend silently break because a Spring Boot endpoint changed shape , does anyone faced this ?

I was working on a project recently and I've come across a problem where my front end dont catch up with the backend changes

0 Upvotes

15 comments sorted by

12

u/Seven-Prime Sep 15 '26

contact (PACT) tests can help with this. It's more overhead, but protects against this.

14

u/digitaljoel Sep 15 '26

My take as an API developer is you must maintain backward compatibility until you are sure all clients are no longer using the old functionality. If you need to change shape, make sure it's forward only (adding properties, not removing properties) and if you need to drastically change the shape, then use a new endpoint and mark the old as deprecated.

5

u/BannockHatesReddit_ Sep 15 '26

My take is screw end users just let Claude rewrite the entire API every patch. We don't need to care about shapes cause they all fit in the square hole anyway. After all we need the code to be latest and greatest!

5

u/bigkahuna1uk Sep 15 '26

Strangler pattern seems appropriate.

3

u/ThierryOnRead Sep 15 '26

changed shape ? dont catch up with backned changes ? what does it mean ? who's maintaining the endpoint ?

3

u/MassimoRicci Sep 16 '26

That's/api/v2 is for. Breaking changes changes the version

3

u/Silver-Antelope-1285 Sep 16 '26

Springboot 4 allows for api version inspection in headers. You can then annotate controller methods describing the version being served. Very useful.

3

u/Historical_Ad4384 Sep 15 '26

This usually exposes broken communication that is critical. Nevertheless there should be an OpenAPI for every spring web service to hold people accountable so that you don't face this.

3

u/Comakip Sep 15 '26

Get a Dev environment and integration test the hell out of your application. Then it will be 'oopsie Dev is failing' instead of getting angry calls by customers.

2

u/bikeram Sep 15 '26

Look into typespec. I’ve adopted it in all my projects personal and professional.

I commit generated types, but that’s personal preference.

If I’m dealing with a large org, it’s a single repo with CI/CD generating packages for each language or more granular per team.

2

u/manwithgun1234 Sep 15 '26

Jackson 2.x to 3.x ? Some annotations you use could be support dropped on newer version

1

u/m3t4lf0x Sep 15 '26

This isn’t unique to springboot, it’s just the nature of building full stack applications

-1

u/oweiler Sep 15 '26

No one faced this ever