@@ -15,6 +15,7 @@ import io.openapiprocessor.core.builder.api.`interface`
1515import io.openapiprocessor.core.converter.ApiOptions
1616import io.openapiprocessor.core.converter.mapping.AnnotationTypeMapping
1717import io.openapiprocessor.core.converter.mapping.ParameterAnnotationTypeMapping
18+ import io.openapiprocessor.core.converter.mapping.SimpleParameterValue
1819import io.openapiprocessor.core.extractBody
1920import io.openapiprocessor.core.extractImports
2021import io.openapiprocessor.core.framework.FrameworkAnnotations
@@ -29,6 +30,10 @@ import io.openapiprocessor.core.support.datatypes.ObjectDataType
2930import io.openapiprocessor.core.support.datatypes.propertyDataTypeString
3031import java.io.StringWriter
3132import java.io.Writer
33+ import kotlin.Boolean
34+ import kotlin.Pair
35+ import kotlin.String
36+ import kotlin.to
3237import io.mockk.mockk as stub
3338import io.openapiprocessor.core.converter.mapping.Annotation as AnnotationMapping
3439
@@ -64,6 +69,27 @@ class InterfaceWriterSpec: StringSpec({
6469 extractImports(target) shouldContain " import annotation.Mapping;"
6570 }
6671
72+ " writes mapping parameter import" {
73+ every { annotations.getAnnotation(any<HttpMethod >()) } returns Annotation (
74+ "annotation.Mapping ", linkedMapOf(
75+ "parameter" to SimpleParameterValue ("Parameter ", "parameter.Parameter ")
76+ )
77+ )
78+
79+ val itf = `interface` {
80+ endpoint("/foo") {
81+ responses { status("200") }
82+ }
83+ }
84+
85+ // when:
86+ writer.write(target, itf)
87+
88+ // then:
89+ extractImports(target) shouldContain " import annotation.Mapping;"
90+ extractImports(target) shouldContain " import parameter.Parameter;"
91+ }
92+
6793 " writes multiple mapping imports" {
6894 every { annotations.getAnnotation(any<HttpMethod >()) } returnsMany listOf(
6995 Annotation ("annotation.MappingA "),
0 commit comments