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
[java gen] - Support generated annotations #4406
[java gen] - Support generated annotations #4406
Conversation
6058508
to
320cac5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor cleanups, but this is great work! Thanks a ton @fabiobrz !
java-generator/core/src/main/java/io/fabric8/java/generator/nodes/AbstractJSONSchema2Pojo.java
Outdated
Show resolved
Hide resolved
java-generator/core/src/main/java/io/fabric8/java/generator/nodes/JObject.java
Outdated
Show resolved
Hide resolved
java-generator/core/src/main/java/io/fabric8/java/generator/nodes/AbstractJSONSchema2Pojo.java
Outdated
Show resolved
Hide resolved
2d188d8
to
150ddf6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this contribution @fabiobrz !
LGTM!
150ddf6
to
7d9040f
Compare
Hi @manusa - one e2e tests failed after I squashed my commits, although it was green already before that. |
cc. @manusa looking forward for your input here 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx!
I think it would be worth adding a note on the the breaking changes list, since some users who might be using the Java generator, rely on the javax validation annotations that are no longer added.
This also raises the question: as a developer relying on the java generator, how can I further transform the generated code to replace fabric8-fabric8 specific annotations with annotations that might be usedeful for my project (e.g. javax.validation)?
I agree, just want to note that the Java-Generator is still in "preview", so breaking changes are fine there. Regarding your additional question, we should come up with something for sure ... 😓 I have a couple of half-baked ideas in mind but am not convinced yet, open to suggestions! |
Hi @manusa - thanks for your feedback, will do.
I've been discussing this shortly with @andreaTP as well last week. This would allow for them to be worked on asynchronously and for the support to different framework to be released in steps. WDYT? CC @andreaTP |
This is an interesting idea, but I'm afraid to add this complexity to the core I'm thinking about adding the possibility to arbitrarily customize the generated code before emitting it, offering a Visitor or Traverse pattern that can perform generic post-processing. On top of that mechanism, we can implement separate plugins for each of the features we want to support, and they can possibly live in separate repositories/projects. Note: the described mechanism might be used as a foundation to implement optimizations, such as class deduplication and similar. |
Thanks @andreaTP! |
7d9040f
to
13bbb10
Compare
Done, should be ready fr merge as soon as CI checks pass. FYI @manusa |
Kudos, SonarCloud Quality Gate passed! |
Thanks! |
Description
The changes are related to those in #4348
The generator will now generate the expected annotations, i.e. those defined in
io.fabric8.generator.annotation
, the same ones that a reverse CRD generation from the Java model take into account.Fix #4384
Type of change
test, version modification, documentation, etc.)
Checklist
I can suash the commits as soon as this is ready for merge or even earlier in case we agree on it.
FYI @andreaTP, CC @manusa