Adrian Witaszak
03/28/2024, 5:57 PM@Route
, in the OpenApi module i want to pickup those annotations to generate the spec. The issue is that if i apply the processor to the openApi module it sees its only module but not submodules. Is there any trick for it?
- annotation
- processor
- open-api // here i need to generate code. Processor applied here
- function // lambda functions here
- getHello // here i use the annotation
- addHello // here i use the annotation
Ting-Yuan Huang
03/28/2024, 6:23 PMResolver.getSymboslWithAnnotation
returns elements from the current module only. To work it around, traversing all elements from Resolver.getDeclarationsFromPackage
in the root module (that depend on all sub modules) and checks the annotations manually might be feasible if the project isn't too large.Adrian Witaszak
03/29/2024, 10:00 AMval routes = resolver
.getDeclarationsFromPackage("")
.filterIsInstance<KSClassDeclaration>()
.filter { classDeclaration ->
classDeclaration.annotations.any { annotation ->
annotation.shortName.asString() == Route::class.simpleName
}
}
The new issue I have now is that newfound annotation overrides the previous one, but i will get this fixed