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
[crd-generator] Implement SchemaSwap #3797
Conversation
@iocanel would you be able to release a new version of |
864c6ae
to
3b8b7a2
Compare
Ready for review 🎉 cc. @metacosm |
3b8b7a2
to
74ba3ff
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.
LGTM. Thank you!
SonarCloud Quality Gate failed. |
Description
This is a
Draftimplementation ofSchemaSwap
.The annotation serves to enable the use-case where you want to generate a valid CRD from a model that you don't own.
e.g.:
The model comes as a dependency on the classpath and you cannot add
SchemaFrom
annotations to it.Issue found in (cc. @vmuzikar):
keycloak/keycloak#9759
I'm opening this PR as Draft to start the conversation regarding pros/cons and alternatives to this approach.
PRO:
SchemaFrom
annotations in a hierarchy without punctual changes[not implemented yet] we can implement aguard to throw an exception in case of fields/classes not foundCONS:the CRD api module cannot be easily executed anymore outside anAnnotationProcessor
(theREFLECTION_CONTEXT
doesn't preserve Annotations at the class level cc. @iocanel )Adding the APT Context subtly breaks the extraction of the Map value typeI'm happy to gather feedback and alternative proposals! cc. @metacosm @iocanel
Type of change
test, version modification, documentation, etc.)
Checklist