-
Hi, all I'm trying to create an extension, a build step, that replaces or adds the For example: @BuildStep
public void processPathAnnotation(
...
BuildProducer<AnnotationsTransformerBuildItem> transformerProducer) {
...
transformerProducer.produce(
new AnnotationsTransformerBuildItem(
new AnnotationsTransformer.ClassTransformerBuilder()
.whenClass(o -> o.name().equals(mapping.implClass.name()))
.thenTransform(
transformation -> transformation.add(
PATH_ANNOTATION_DOT_NAME,
AnnotationValue.createStringValue("value", newPath)
)
)
)
);
... But my transformation is always invoked after I would appreciate any help! p.s. I've tried many things ( best |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi!
Same for bytecode transformation unfortunately because the bytecode transformation is executed after the classes are indexed in Jandex. And RESTEasy Classic uses the Jandex index. Now maybe you should have a look at RESTEasy Reactive (that we will rename Quarkus REST in 3.9, can be used for both reactive and blocking and is our default REST layer now) because I know it has a layer similar to annotations transformer (but specific to Quarkus REST). @geoand will be able to tell you if what you want to do is doable. Also it might be a good idea to have a look at the Quarkus Spring Web extensions that provide a compatibility layer for Spring Web and actually registers REST resources (there is an extension for Quarkus REST and another for RESTEasy Classic, with a few things shared between the two). |
Beta Was this translation helpful? Give feedback.
I completely agree with everything @gsmet said.
What you are trying to do will be fairly easy with the custom annotation transformer API that Quarkus REST provides