|
1 | 1 | package io.swagger.codegen.languages;
|
2 | 2 |
|
3 |
| -import com.google.common.base.Predicate; |
4 |
| -import com.google.common.collect.Iterators; |
5 |
| -import com.google.common.collect.Lists; |
6 |
| - |
7 |
| -import io.swagger.codegen.CliOption; |
8 |
| -import io.swagger.codegen.CodegenConfig; |
9 |
| -import io.swagger.codegen.CodegenConstants; |
10 |
| -import io.swagger.codegen.CodegenModel; |
11 |
| -import io.swagger.codegen.CodegenProperty; |
12 |
| -import io.swagger.codegen.CodegenType; |
13 |
| -import io.swagger.codegen.DefaultCodegen; |
14 |
| -import io.swagger.codegen.SupportingFile; |
15 |
| - |
| 3 | +import io.swagger.codegen.*; |
16 | 4 | import io.swagger.models.Model;
|
17 | 5 | import io.swagger.models.ModelImpl;
|
18 | 6 | import io.swagger.models.Operation;
|
19 | 7 | import io.swagger.models.Swagger;
|
20 |
| -import io.swagger.models.parameters.HeaderParameter; |
21 |
| -import io.swagger.models.parameters.Parameter; |
22 | 8 | import io.swagger.models.properties.ArrayProperty;
|
23 | 9 | import io.swagger.models.properties.MapProperty;
|
24 | 10 | import io.swagger.models.properties.Property;
|
25 |
| - |
26 | 11 | import org.apache.commons.lang3.ArrayUtils;
|
27 | 12 | import org.apache.commons.lang3.StringUtils;
|
28 | 13 | import org.apache.commons.lang3.text.WordUtils;
|
29 | 14 |
|
30 | 15 | import java.io.File;
|
31 |
| -import java.util.ArrayList; |
32 |
| -import java.util.Arrays; |
33 |
| -import java.util.HashMap; |
34 |
| -import java.util.HashSet; |
35 |
| -import java.util.Iterator; |
36 |
| -import java.util.List; |
37 |
| -import java.util.Map; |
| 16 | +import java.util.*; |
38 | 17 | import java.util.regex.Matcher;
|
39 | 18 | import java.util.regex.Pattern;
|
40 |
| -import javax.annotation.Nullable; |
41 | 19 |
|
42 | 20 | public class Swift5Codegen extends DefaultCodegen implements CodegenConfig {
|
43 | 21 | public static final String PROJECT_NAME = "projectName";
|
@@ -587,6 +565,17 @@ public CodegenModel fromModel(String name, Model model, Map<String, Model> allDe
|
587 | 565 | return codegenModel;
|
588 | 566 | }
|
589 | 567 |
|
| 568 | + @Override |
| 569 | + public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map<String, Model> definitions, Swagger swagger) { |
| 570 | + CodegenOperation codegenOperation = super.fromOperation(path, httpMethod, operation, definitions, swagger); |
| 571 | + |
| 572 | + if (codegenOperation.returnType != null && codegenOperation.returnType.equals("Any")) { |
| 573 | + codegenOperation.returnType = null; |
| 574 | + } |
| 575 | + |
| 576 | + return codegenOperation; |
| 577 | + } |
| 578 | + |
590 | 579 | public void setProjectName(String projectName) {
|
591 | 580 | this.projectName = projectName;
|
592 | 581 | }
|
|
0 commit comments