Skip to content

Commit 22e6785

Browse files
committed
preserve generic wildcard parameter
1 parent d42503b commit 22e6785

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

  • openapi-processor-core/src

openapi-processor-core/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

openapi-processor-core/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)