File tree Expand file tree Collapse file tree 5 files changed +24
-16
lines changed
kotlin-asyncapi-core/src/main/kotlin/org/openfolder/kotlinasyncapi/model/channel
kotlin-asyncapi-spring-web
src/main/kotlin/org/openfolder/kotlinasyncapi/springweb Expand file tree Collapse file tree 5 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ class Channel {
2222 var parameters: ReferencableParametersMap ? = null
2323 var bindings: Any? = null
2424
25- @Deprecated(" Usage of the \$ ref property has been deprecated" )
25+ @Deprecated(
26+ message = " Usage of the \$ ref property has been deprecated" ,
27+ replaceWith = ReplaceWith (" Reference().ref()" )
28+ )
2629 fun ref (value : String ): String =
2730 value.also { `$ref` = it }
2831
Original file line number Diff line number Diff line change 3939 <groupId >io.swagger.core.v3</groupId >
4040 <artifactId >swagger-core</artifactId >
4141 </dependency >
42+ <dependency >
43+ <groupId >io.github.classgraph</groupId >
44+ <artifactId >classgraph</artifactId >
45+ </dependency >
4246 <dependency >
4347 <groupId >org.springframework</groupId >
4448 <artifactId >spring-web</artifactId >
Original file line number Diff line number Diff line change @@ -101,8 +101,8 @@ internal open class AsyncApiAnnotationAutoConfiguration {
101101 ChannelProcessor ()
102102
103103 @Bean
104- open fun annotationScanner (context : ApplicationContext ) =
105- DefaultAnnotationScanner (context )
104+ open fun annotationScanner () =
105+ DefaultAnnotationScanner ()
106106
107107 @Bean
108108 open fun annotationProvider (
Original file line number Diff line number Diff line change 11package org.openfolder.kotlinasyncapi.springweb.context.annotation
22
3- import org.openfolder.kotlinasyncapi.annotation.AsyncApiAnnotation
4- import org.springframework.context.ApplicationContext
5- import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
6- import org.springframework.core.type.filter.AnnotationTypeFilter
3+ import io.github.classgraph.ClassGraph
74import org.springframework.stereotype.Component
85import kotlin.reflect.KClass
96
@@ -12,16 +9,15 @@ internal interface AnnotationScanner {
129}
1310
1411@Component
15- internal class DefaultAnnotationScanner (
16- private val context : ApplicationContext
17- ) : AnnotationScanner {
12+ internal class DefaultAnnotationScanner : AnnotationScanner {
1813 override fun scan (scanPackage : String , annotation : KClass <out Annotation >): List <KClass <* >> {
19- val classPathScanner = ClassPathScanningCandidateComponentProvider (false ).also {
20- it.addIncludeFilter(AnnotationTypeFilter (AsyncApiAnnotation ::class .java))
21- }
14+ val packageClasses = ClassGraph ()
15+ .enableAllInfo()
16+ .acceptPackages(scanPackage)
17+ .scan()
2218
23- return classPathScanner.findCandidateComponents(scanPackage) .map {
24- Class .forName( it.beanClassName ).kotlin
25- }.toList()
19+ return packageClasses.getClassesWithAnnotation(annotation.java).standardClasses .map {
20+ it.loadClass( ).kotlin
21+ }
2622 }
2723}
Original file line number Diff line number Diff line change 255255 <artifactId >swagger-core</artifactId >
256256 <version >2.2.8</version >
257257 </dependency >
258+ <dependency >
259+ <groupId >io.github.classgraph</groupId >
260+ <artifactId >classgraph</artifactId >
261+ <version >4.8.157</version >
262+ </dependency >
258263 <dependency >
259264 <groupId >org.jetbrains.kotlin</groupId >
260265 <artifactId >kotlin-scripting-jvm-host</artifactId >
You can’t perform that action at this time.
0 commit comments