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

Please add a parameter ( jakartaForKafkaValidation? ) to support both javax.validation and jakarta.validation packages #297

Closed
jbiscella opened this issue May 18, 2023 · 2 comments · Fixed by #313
Labels
enhancement New feature or request released

Comments

@jbiscella
Copy link

jbiscella commented May 18, 2023

Reason/Context

While using the generator with spring boot 3.*, the imports will fail as the package javax.validation has been renamed to jakarta.validation

Description

Please try answering few of those questions

  • What changes have to be introduced?
  1. add the following code to the parameters of package.json (or pick a better naming):
"jakartaForKafkaValidation": {
        "description": "To check if the target framework will leverage on javax.validation or jakarta.validation package for kafka",
        "default": "false",
        "required": false
      }
  1. in $$message$$.java replace the import of javax.validation with
{% if params.jakartaForKafkaValidation === 'false' %}
import javax.validation.Valid;
{% else %}
import jakarta.validation.Valid;
{% endif %}
  1. in $$onjectSchema$$.java replace the import of javax.validation with:
{% if params.jakartaForKafkaValidation === 'false' %}
import javax.validation.constraints.*;
import javax.validation.Valid;
{% else %}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
{% endif %}
  • Will this be a breaking change?
    not with a safe default
  • How could it be implemented/designed?
    please see my previous answers: note that is an advise as I do not know in detail the templating engine. Sadly I cannot contribute due to company policies
@jbiscella jbiscella added the enhancement New feature or request label May 18, 2023
@Tenischev
Copy link
Member

Hello @jbiscella
Thank you for the report! There is also some changes in spring-kafka 3.0 which is used together with spring-boot 3.0

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants