r/SpringBoot • • 20d ago

News We replaced our hand-written REST client with a schema-generated one: what improved, and what didn't change

/r/graphlinkdotdev/comments/1xwkor0/we_replaced_our_handwritten_rest_client_with_a/
5 Upvotes

7 comments sorted by

6

u/trodiix 20d ago

They did it with the keycloak admin apis that already have a java client provided by keycloak, what they did is stupid, I wouldn't trust this article

0

u/graphlinkdev 20d ago

Sure, you should think of it as more of a POC. In our server we used to use restclient, avoiding the library because we needed only 3 operations.

Graphlink has a different philosophy than retrofit but inspired by it for both rest and graphql clients. It basically generates all the linkage between the client and the server including the data classe and null-safety with zero usage of generics and less usage of reflection apps.

2

u/perfectstrong 20d ago

1

u/graphlinkdev 20d ago

There is one but the app is so messed up, besides we only needed about 4 operations. What generated code gives you with graphlink is optimal serialization and programming language independence (well for the languages it targets).

This was more of a POC and a good replacement for both rest api clients a graphql ones.

1

u/sereikis 19d ago

the 'contract drift is a compile error' claim needs a boundary: an upstream Keycloak change can still compile cleanly if your local schema hasn't changed. keep an integration test against the Keycloak versions you support, since a fake server built from that same schema can agree with the client while both disagree with the real API.

1

u/graphlinkdev 18d ago

That is actually a great idea. I do integration tests against database but not for kc. The goal was actually to show how easy to use scheme driven code generation for java an 6 other languages to create typeface and nullified clients for both graphql and REST

2

u/This_Link881 20d ago

In 2026? You shouldn't rush, bro.