|
20 | 20 | import io.swagger.v3.oas.models.media.Schema;
|
21 | 21 | import io.swagger.v3.parser.util.SchemaTypeUtil;
|
22 | 22 | import org.apache.commons.lang3.StringUtils;
|
23 |
| -import org.openapitools.codegen.CliOption; |
24 |
| -import org.openapitools.codegen.CodegenModel; |
25 |
| -import org.openapitools.codegen.CodegenProperty; |
26 |
| -import org.openapitools.codegen.CodegenOperation; |
27 |
| -import org.openapitools.codegen.SupportingFile; |
| 23 | +import org.openapitools.codegen.*; |
28 | 24 | import org.openapitools.codegen.meta.features.DocumentationFeature;
|
29 | 25 | import org.openapitools.codegen.utils.ModelUtils;
|
30 | 26 |
|
@@ -146,15 +142,18 @@ public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> o
|
146 | 142 | .filter(op -> op.consumes.stream().anyMatch(opc -> opc.values().stream().anyMatch("multipart/form-data"::equals)))
|
147 | 143 | .forEach(op -> {
|
148 | 144 | op.vendorExtensions.putIfAbsent("multipartFormData", true);
|
149 |
| - op.allParams.stream() |
150 |
| - .filter(param -> param.isFormParam) |
151 |
| - .filter(param -> param.isArray) |
152 |
| - .filter(param -> param.dataFormat.equals("binary")) |
153 |
| - .forEach(param -> param.isCollectionFormatMulti = true); |
154 | 145 | });
|
155 | 146 | return objs;
|
156 | 147 | }
|
157 | 148 |
|
| 149 | + @Override |
| 150 | + public void postProcessParameter(CodegenParameter parameter) { |
| 151 | + super.postProcessParameter(parameter); |
| 152 | + if (parameter.isFormParam && parameter.isArray && "binary".equals(parameter.dataFormat)) { |
| 153 | + parameter.isCollectionFormatMulti = true; |
| 154 | + } |
| 155 | + } |
| 156 | + |
158 | 157 | @Override
|
159 | 158 | public Map<String, Object> postProcessAllModels(Map<String, Object> objs) {
|
160 | 159 | Map<String, Object> result = super.postProcessAllModels(objs);
|
|
0 commit comments