Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot validate data classes in separate modules #482

Open
Andrey-jpeg opened this issue Jan 29, 2025 · 4 comments
Open

Cannot validate data classes in separate modules #482

Andrey-jpeg opened this issue Jan 29, 2025 · 4 comments

Comments

@Andrey-jpeg
Copy link

Andrey-jpeg commented Jan 29, 2025

Expected Behavior

When I use @Introspected to import a data class from a separate module, it should be validated when I issue a HTTP request, the same as it did in Micronaut 3

Actual Behaviour

Validation is fully skipped on requests in separate modules, althought it has been imported using @Introspected

Steps To Reproduce

  1. Create a separate module
  2. add your models to the module
  3. Apply jakarta annotations to models
  4. Create a controller in your main app, that introspects model from separate module
  5. fire a request, against any controller method that has introspected models from separate module

Environment Information

  • operating system: mac os
  • jdk 21
  • KSP
  • Jackson

Example Application

https://github.com/Andrey-jpeg/validation-different-modules

Version

4.7.4

@dstepanov
Copy link
Contributor

You need to include the annotation processors in your other module.

@Andrey-jpeg
Copy link
Author

Hi, I've added the annotation processors, sorry I forgot that was necessary. However the request still doesn't seem to get validated 🤔 I find it weird cause ksp does generate the code.

@dstepanov
Copy link
Contributor

Please update the project to check

@Andrey-jpeg
Copy link
Author

Checked again on version 4.8.0.

You can check out my example application and run tests to confirm.

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

No branches or pull requests

2 participants