Skip to content

Commit 4293af3

Browse files
authored
Merge pull request #2 from Tovkal/issue-9386-fix-any-codable
Make return types Void instead of Any
2 parents 42ad411 + 985ee0a commit 4293af3

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift5Codegen.java

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,21 @@
11
package io.swagger.codegen.languages;
22

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.*;
164
import io.swagger.models.Model;
175
import io.swagger.models.ModelImpl;
186
import io.swagger.models.Operation;
197
import io.swagger.models.Swagger;
20-
import io.swagger.models.parameters.HeaderParameter;
21-
import io.swagger.models.parameters.Parameter;
228
import io.swagger.models.properties.ArrayProperty;
239
import io.swagger.models.properties.MapProperty;
2410
import io.swagger.models.properties.Property;
25-
2611
import org.apache.commons.lang3.ArrayUtils;
2712
import org.apache.commons.lang3.StringUtils;
2813
import org.apache.commons.lang3.text.WordUtils;
2914

3015
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.*;
3817
import java.util.regex.Matcher;
3918
import java.util.regex.Pattern;
40-
import javax.annotation.Nullable;
4119

4220
public class Swift5Codegen extends DefaultCodegen implements CodegenConfig {
4321
public static final String PROJECT_NAME = "projectName";
@@ -587,6 +565,17 @@ public CodegenModel fromModel(String name, Model model, Map<String, Model> allDe
587565
return codegenModel;
588566
}
589567

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+
590579
public void setProjectName(String projectName) {
591580
this.projectName = projectName;
592581
}

0 commit comments

Comments
 (0)