Skip to content

Commit 0db991c

Browse files
committed
openapi-processor/openapi-processor-spring#150, avoid additional constructor
1 parent f1d5c38 commit 0db991c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

openapi-processor-core/src/main/kotlin/io/openapiprocessor/core/converter/mapping/TypeMapping.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,15 @@ class TypeMapping (
4242

4343
): Mapping, TargetTypeMapping {
4444

45+
// used in tests only
4546
constructor(sourceTypeName: String?, targetTypeName: String):
4647
this (sourceTypeName, null, targetTypeName, emptyList())
4748

49+
// used in tests only
4850
constructor(sourceTypeName: String?, sourceTypeFormat: String?, targetTypeName: String):
4951
this (sourceTypeName, sourceTypeFormat, targetTypeName, emptyList())
5052

53+
// used in tests only
5154
constructor(sourceTypeName: String?, targetTypeName: String, genericTypeNames: List<String>):
5255
this (sourceTypeName, null, targetTypeName, genericTypeNames)
5356

openapi-processor-core/src/main/kotlin/io/openapiprocessor/core/processor/mapping/v2/MappingConverter.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ class MappingConverter(val mapping: MappingV2) {
8787

8888
private fun convertType (from: String, to: String): Mapping {
8989
val mapping = parseMapping(to)
90-
return TypeMapping(from, resolvePackageVariable(mapping.targetType!!))
90+
return TypeMapping(
91+
from,
92+
null,
93+
resolvePackageVariable(mapping.targetType!!))
9194
}
9295

9396
private fun convertType(source: Type): Mapping {

0 commit comments

Comments
 (0)