Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Commit eaefb89

Browse files
committed
preserve generic wildcard parameter
1 parent 7383767 commit eaefb89

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/main/kotlin/io/openapiprocessor/core/processor/mapping/v2/parser/ToExtractor.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ class ToExtractor: ToBaseListener() {
3535
ctx.typeArguments ()
3636
?.typeArgumentList ()
3737
?.typeArgument ()
38-
?.filter { it.type() != null }
3938
?.forEach {
40-
typeArguments.add(it.type ().text)
39+
if (it.text == "?") {
40+
typeArguments.add("?")
41+
} else if (it.type() != null) {
42+
typeArguments.add(it.type ().text)
43+
}
4144
}
4245
}
4346

src/test/groovy/io/openapiprocessor/core/processor/mapping/v2/parser/ToParserSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ToParserSpec extends Specification {
3535
'io.openapiprocessor.Foo' | 'io.openapiprocessor.Foo' | []
3636
' io . openapiprocessor . Foo ' | 'io.openapiprocessor.Foo' | []
3737
'A<>' | 'A' | []
38-
'A<?>' | 'A' | []
38+
'A<?>' | 'A' | ['?']
3939
'A<b.B, c.C>' | 'A' | ['b.B', 'c.C']
4040
'A<B, C>' | 'A' | ['B', 'C']
4141
}

0 commit comments

Comments
 (0)