File tree Expand file tree Collapse file tree
openapi-processor-core/src
main/kotlin/io/openapiprocessor/core/converter
test/kotlin/io/openapiprocessor/core/converter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,9 +60,11 @@ class MappingFinder(private val typeMappings: List<Mapping> = emptyList()) {
6060 return typeMappings
6161 .filterIsInstance<AnnotationTypeMapping >()
6262 .filter {
63+ val matchObject = it.sourceTypeName == " object"
6364 val matchType = it.sourceTypeName == type
6465 val matchFormat = it.sourceTypeFormat == format
65- matchType && matchFormat
66+
67+ (matchType && matchFormat) || (matchObject && matchFormat)
6668 }
6769 }
6870
Original file line number Diff line number Diff line change @@ -26,6 +26,19 @@ class MappingFinderAnnotationSpec: StringSpec({
2626 mapping.first().sourceTypeName shouldBe " Foo"
2727 }
2828
29+ " find 'object' type annotation mapping" {
30+ val finder = MappingFinder (listOf(
31+ AnnotationTypeMapping (
32+ "object", null,
33+ Annotation ("annotation.Bar "))
34+ ))
35+
36+ val mapping = finder.findTypeAnnotations("Foo ")
37+
38+ mapping.size shouldBe 1
39+ mapping.first().sourceTypeName shouldBe " object"
40+ }
41+
2942 " find type:format annotation mapping" {
3043 val finder = MappingFinder (listOf(
3144 AnnotationTypeMapping (
You can’t perform that action at this time.
0 commit comments