@@ -110,20 +110,6 @@ class MappingConverter(val mapping: MappingV2) {
110
110
}
111
111
}
112
112
113
- private fun createParameterTypeMapping (source : RequestParameter ): ParameterTypeMapping {
114
- val (mapping, genericTypes, genericTypeNames) = parseMapping(source.name, source.generics)
115
-
116
- val typeMapping = TypeMapping (
117
- null ,
118
- null ,
119
- resolvePackageVariable(mapping.targetType!! ),
120
- resolvePackageVariable(genericTypeNames),
121
- genericTypes
122
- )
123
-
124
- return ParameterTypeMapping (mapping.sourceType!! , typeMapping)
125
- }
126
-
127
113
private fun convertParameter (source : Parameter ): Mapping {
128
114
// parameters:
129
115
return when (source) {
@@ -150,6 +136,40 @@ class MappingConverter(val mapping: MappingV2) {
150
136
}
151
137
}
152
138
139
+ private fun createParameterTypeMapping (source : RequestParameter ): ParameterTypeMapping {
140
+ val (mapping, genericTypes, genericTypeNames) = parseMapping(source.name, source.generics)
141
+
142
+ val typeMapping = TypeMapping (
143
+ null ,
144
+ null ,
145
+ resolvePackageVariable(mapping.targetType!! ),
146
+ resolvePackageVariable(genericTypeNames),
147
+ genericTypes
148
+ )
149
+
150
+ return ParameterTypeMapping (mapping.sourceType!! , typeMapping)
151
+ }
152
+
153
+ private fun createAddParameterTypeMapping (source : AdditionalParameter ): AddParameterTypeMapping {
154
+ val (mapping, genericTypes, genericTypeNames) = parseMapping(source.add, source.generics)
155
+
156
+ val typeMapping = TypeMapping (
157
+ null ,
158
+ null ,
159
+ resolvePackageVariable(mapping.targetType!! ),
160
+ resolvePackageVariable(genericTypeNames),
161
+ genericTypes
162
+ )
163
+
164
+ var annotation: io.openapiprocessor.core.converter.mapping.Annotation ? = null
165
+ if (mapping.annotationType != null ) {
166
+ annotation = Annotation (
167
+ mapping.annotationType!! , mapping.annotationParameters)
168
+ }
169
+
170
+ return AddParameterTypeMapping (mapping.sourceType!! , typeMapping, annotation)
171
+ }
172
+
153
173
data class ParsedMapping (
154
174
val mapping : ParserMapping ,
155
175
val genericTypes : List <TargetType >,
@@ -198,30 +218,6 @@ class MappingConverter(val mapping: MappingV2) {
198
218
.collect(Collectors .toList())
199
219
}
200
220
201
- private fun createAddParameterTypeMapping (source : AdditionalParameter ): AddParameterTypeMapping {
202
- val mapping = parseMapping(source.add)
203
-
204
- val targetGenericTypes = mapping.targetGenericTypes.toMutableList()
205
- if (targetGenericTypes.isEmpty() && source.generics != null ) {
206
- targetGenericTypes.addAll(source.generics)
207
- }
208
-
209
- val typeMapping = TypeMapping (
210
- null ,
211
- null ,
212
- resolvePackageVariable(mapping.targetType!! ),
213
- resolvePackageVariable(targetGenericTypes)
214
- )
215
-
216
- var annotation: io.openapiprocessor.core.converter.mapping.Annotation ? = null
217
- if (mapping.annotationType != null ) {
218
- annotation = Annotation (
219
- mapping.annotationType!! , mapping.annotationParameters)
220
- }
221
-
222
- return AddParameterTypeMapping (mapping.sourceType!! , typeMapping, annotation)
223
- }
224
-
225
221
private fun convertResponse (source : Response ): Mapping {
226
222
val mapping = parseMapping(source.content)
227
223
0 commit comments