@@ -66,7 +66,7 @@ class MappingConverter(val mapping: MappingV2) {
6666
6767 private fun convertResult (result : String ): Mapping {
6868 val mapping = parseMapping(result)
69- return ResultTypeMapping (resolvePackageVariable(mapping.targetType))
69+ return ResultTypeMapping (resolvePackageVariable(mapping.targetType!! ))
7070 }
7171
7272 private fun convertNull (value : String ): Mapping {
@@ -84,28 +84,28 @@ class MappingConverter(val mapping: MappingV2) {
8484
8585 private fun convertType (from : String , to : String ): Mapping {
8686 val mapping = parseMapping(to)
87- return TypeMapping (from, resolvePackageVariable(mapping.targetType))
87+ return TypeMapping (from, resolvePackageVariable(mapping.targetType!! ))
8888 }
8989
9090 private fun convertType (source : Type ): Mapping {
9191 val mapping = parseMapping(source.type)
9292
93- val targetGenericTypes = mapping.targetGenericTypes
93+ val targetGenericTypes = mapping.targetGenericTypes.toMutableList()
9494 if (targetGenericTypes.isEmpty() && source.generics != null ) {
9595 targetGenericTypes.addAll(source.generics)
9696 }
9797
9898 return if (mapping.kind == ANNOTATE ) {
9999 AnnotationTypeMapping (
100- mapping.sourceType,
100+ mapping.sourceType!! ,
101101 mapping.sourceFormat,
102- Annotation (mapping.annotationType, null , mapping.annotationParameters)
102+ Annotation (mapping.annotationType!! , null , mapping.annotationParameters)
103103 )
104104 } else {
105105 TypeMapping (
106106 mapping.sourceType,
107107 mapping.sourceFormat,
108- resolvePackageVariable(mapping.targetType),
108+ resolvePackageVariable(mapping.targetType!! ),
109109 resolvePackageVariable(targetGenericTypes)
110110 )
111111 }
@@ -136,61 +136,61 @@ class MappingConverter(val mapping: MappingV2) {
136136 private fun createParameterTypeMapping (source : RequestParameter ): ParameterTypeMapping {
137137 val mapping = parseMapping(source.name)
138138
139- val targetGenericTypes = mapping.targetGenericTypes
139+ val targetGenericTypes = mapping.targetGenericTypes.toMutableList()
140140 if (targetGenericTypes.isEmpty() && source.generics != null ) {
141141 targetGenericTypes.addAll(source.generics)
142142 }
143143
144144 val typeMapping = TypeMapping (
145145 null ,
146146 null ,
147- resolvePackageVariable(mapping.targetType),
147+ resolvePackageVariable(mapping.targetType!! ),
148148 resolvePackageVariable(targetGenericTypes)
149149 )
150150
151- return ParameterTypeMapping (mapping.sourceType, typeMapping)
151+ return ParameterTypeMapping (mapping.sourceType!! , typeMapping)
152152 }
153153
154154 private fun createAddParameterTypeMapping (source : AdditionalParameter ): AddParameterTypeMapping {
155155 val mapping = parseMapping(source.add)
156156
157- val targetGenericTypes = mapping.targetGenericTypes
157+ val targetGenericTypes = mapping.targetGenericTypes.toMutableList()
158158 if (targetGenericTypes.isEmpty() && source.generics != null ) {
159159 targetGenericTypes.addAll(source.generics)
160160 }
161161
162162 val typeMapping = TypeMapping (
163163 null ,
164164 null ,
165- resolvePackageVariable(mapping.targetType),
165+ resolvePackageVariable(mapping.targetType!! ),
166166 resolvePackageVariable(targetGenericTypes)
167167 )
168168
169169 var annotation: io.openapiprocessor.core.converter.mapping.Annotation ? = null
170170 if (mapping.annotationType != null ) {
171171 annotation = Annotation (
172- mapping.annotationType, null , mapping.annotationParameters)
172+ mapping.annotationType!! , null , mapping.annotationParameters)
173173 }
174174
175- return AddParameterTypeMapping (mapping.sourceType, typeMapping, annotation)
175+ return AddParameterTypeMapping (mapping.sourceType!! , typeMapping, annotation)
176176 }
177177
178178 private fun convertResponse (source : Response ): Mapping {
179179 val mapping = parseMapping(source.content)
180180
181- val targetGenericTypes = mapping.targetGenericTypes
181+ val targetGenericTypes = mapping.targetGenericTypes.toMutableList()
182182 if (targetGenericTypes.isEmpty() && source.generics != null ) {
183183 targetGenericTypes.addAll(source.generics)
184184 }
185185
186186 val typeMapping = TypeMapping (
187187 null ,
188188 null ,
189- resolvePackageVariable(mapping.targetType),
189+ resolvePackageVariable(mapping.targetType!! ),
190190 resolvePackageVariable(targetGenericTypes)
191191 )
192192
193- return ResponseTypeMapping (mapping.sourceType, typeMapping)
193+ return ResponseTypeMapping (mapping.sourceType!! , typeMapping)
194194 }
195195
196196 private fun convertPath (path : String , source : Path ): Mapping {
0 commit comments