Skip to content

Conversation

@krzema12
Copy link
Member

@krzema12 krzema12 commented Jun 23, 2025

The goal is to be able to present a nice error message to the user if an incompatible library version is used with a given server routes version. Right now we have only one server routes version, but we're planning to make some breaking changes and expose /v2/.

@krzema12 krzema12 changed the title WIP: add check of library version in binding from server feat: add check of compatibility between library version and binding Jun 23, 2025
.builder(name = "getLibraryVersion")
.addModifiers(KModifier.INTERNAL)
.returns(String::class)
.addCode(CodeBlock.of("return \"$libraryVersion\""))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the best I could do to pass the version known in build time to the library. I tried with JAR metadata, with no success.


public abstract val usesString: String

public open fun isCompatibleWithLibraryVersion(libraryVersion: String): Boolean = true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll be able to override it in the future releases of the server, so that it runs different logic depending on the version of the server routes.

@krzema12 krzema12 marked this pull request as ready for review June 23, 2025 09:53
@krzema12 krzema12 requested a review from Vampire June 23, 2025 09:54
@krzema12
Copy link
Member Author

Let me merge so that we start with something. At this stage, we can always adjust the approach.

@krzema12 krzema12 merged commit 2b5697f into main Jun 26, 2025
16 checks passed
@krzema12 krzema12 deleted the add-check-of-library-version-in-binding branch June 26, 2025 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants