Skip to content

Commit 9bc94ad

Browse files
committed
provide RequestMapping annotation (openapi-processor/openapi-processor-base#176)
1 parent bd0e6eb commit 9bc94ad

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-jdk = "11"
44
test-jdk = "17"
55

66
api = "2023.1"
7-
base = "2024.5"
7+
base = "2024.6-SNAPSHOT"
88

99
junit = "5.9.3"
1010
jacoco = "0.8.7"

src/main/kotlin/io/openapiprocessor/spring/processor/SpringFrameworkAnnotations.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package io.openapiprocessor.spring.processor
77

88
import io.openapiprocessor.core.converter.mapping.SimpleParameterValue
9+
import io.openapiprocessor.core.framework.AnnotationType
910
import io.openapiprocessor.core.framework.FrameworkAnnotations
1011
import io.openapiprocessor.core.model.Annotation
1112
import io.openapiprocessor.core.model.RequestBody
@@ -44,6 +45,13 @@ class SpringFrameworkAnnotations: FrameworkAnnotations {
4445
}
4546
}
4647

48+
override fun getAnnotation(type: AnnotationType): Annotation {
49+
return when (type) {
50+
AnnotationType.INTERFACE_PATH_PREFIX -> REQUEST_MAPPING_ANNOTATION
51+
else -> throw NotImplementedError()
52+
}
53+
}
54+
4755
private fun getAnnotation(key: String): Annotation {
4856
return PARAMETER_ANNOTATIONS.getValue(key)
4957
}
@@ -57,6 +65,8 @@ class SpringFrameworkAnnotations: FrameworkAnnotations {
5765
}
5866
}
5967

68+
private val REQUEST_MAPPING_ANNOTATION = Annotation(getAnnotationName("RequestMapping"))
69+
6070
private val MAPPING_ANNOTATIONS = hashMapOf(
6171
HttpMethod.DELETE to Annotation(getMappingAnnotationName(HttpMethod.DELETE.method)),
6272
HttpMethod.GET to Annotation(getMappingAnnotationName(HttpMethod.GET.method)),

0 commit comments

Comments
 (0)