Skip to content

Conversation

@angelozerr
Copy link
Contributor

@angelozerr angelozerr commented Nov 7, 2025

Runtime-Based MicroProfile Config Validation for LSP4MP

Fixes #511

Here a sample in application.properties which report error by using SamllRye converter:

image

and in Java files:

image

it is working also with custom enum:

image

The settings "microprofile.tools.validation.value.severity": "none|error|warning" is now used to manage validation value error: in properties and Java files:

image

@angelozerr angelozerr marked this pull request as draft November 7, 2025 21:57
@angelozerr angelozerr force-pushed the runtime_validation branch 27 times, most recently from 1c123ba to faa3481 Compare November 12, 2025 11:52
@angelozerr angelozerr force-pushed the runtime_validation branch 3 times, most recently from 6268068 to 68a0eb0 Compare November 13, 2025 08:05
Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

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

I'll keep looking tomorrow, I'm still trying to understand the code.

@angelozerr angelozerr force-pushed the runtime_validation branch 5 times, most recently from eb4f4d9 to 59de3e7 Compare November 14, 2025 20:20
@angelozerr angelozerr marked this pull request as ready for review November 14, 2025 22:11
@angelozerr angelozerr force-pushed the runtime_validation branch 7 times, most recently from 11dd515 to e019c37 Compare November 18, 2025 21:56
@fbricon
Copy link
Contributor

fbricon commented Nov 19, 2025

Can't we provide an extension point instead for eg. Liberty tools to provide their Validation mechanism, and just disable value validation if none is provided?

There are several things I'm not comfortable with:

  • storing jars in a git repo, when they could be downloaded at build time
  • hardcoding jar names+ arbitrary versions in the code

@angelozerr
Copy link
Contributor Author

Can't we provide an extension point instead for eg. Liberty tools to provide their Validation mechanism, and just disable value validation if none is provided?

It is not only for Liberty Tools, it is for other MP project which have no MP implementation in their classpath.

We could indeed providing an extension point for that, but I am not sure that it is really interesting. This PR has been tested with Quarkus/Liberty project on all OS and it seems it is working pretty well.

I would like to merge this PR and work on evaluate mode like I have explained in #511 (comment)

There are several things I'm not comfortable with:

  • storing jars in a git repo, when they could be downloaded at build time
  • hardcoding jar names+ arbitrary versions in the code

I agree but can I merge the PR and improve that after the merge. @datho7561 do you think you could work on it?

I would like really working on evaluate mode like I have explained in #511 (comment) because I want to fix (fixed on IJ Quarkus) a lof of false positive erros with property key/values that we have and reported in IJ Quarkus, vscode-quarkus, vscode-microprofile

But for now I need this PR and next PR with evaluate mode to include it in IJ Quarkus which will fix a lot of false positive errors.

@angelozerr
Copy link
Contributor Author

IBM are OK to merge this PR, @datho7561 @fbricon are OK with that?

@angelozerr angelozerr force-pushed the runtime_validation branch 3 times, most recently from 3f6e45f to d13dc1b Compare November 20, 2025 17:54
@angelozerr
Copy link
Contributor Author

angelozerr commented Nov 20, 2025

There are several things I'm not comfortable with:

  • storing jars in a git repo, when they could be downloaded at build time

fixed (thanks to @datho7561 )

hardcoding jar names+ arbitrary versions in the code

Now the strategy is different, MicroProfile JDT add those lib in the Bundle CLasspath. I need to do that because SmallRye Config is complex (not OSGIfied and use Java SPI). I spent so many times to try to support this SmallRyeConfig dependency with tycho (like we have with SmallRye expression but without success).

@angelozerr
Copy link
Contributor Author

See PR redhat-developer/vscode-microprofile#546 which defines "microprofile.tools.execution.mode" (safe, full)

@angelozerr
Copy link
Contributor Author

Since IBM has tested the PR with Liberty and me I have tested with Quarkus/Liberty I merged the PR because I would like to integrate thi sfeature in IJ Quarkus which is very expected by user.

If there are some improvement to do in this PR, don't hesitate to create issues.

@angelozerr angelozerr merged commit 9483242 into eclipse-lsp4mp:master Nov 21, 2025
2 of 4 checks passed
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.

Runtime-Based MicroProfile Config Validation for LSP4MP

3 participants