|
6 | 6 | import io.swagger.codegen.v3.CodegenOperation;
|
7 | 7 | import io.swagger.codegen.v3.CodegenProperty;
|
8 | 8 | import io.swagger.codegen.v3.SupportingFile;
|
| 9 | +import io.swagger.v3.oas.models.media.BooleanSchema; |
| 10 | +import io.swagger.v3.oas.models.media.Schema; |
9 | 11 | import org.apache.commons.lang3.StringUtils;
|
10 | 12 |
|
11 | 13 | import java.util.ArrayList;
|
|
15 | 17 | import java.util.Map;
|
16 | 18 | import java.util.TreeSet;
|
17 | 19 |
|
| 20 | +import static io.swagger.codegen.v3.CodegenConstants.IS_CONTAINER_EXT_NAME; |
18 | 21 | import static io.swagger.codegen.v3.generators.handlebars.ExtensionHelper.getBooleanValue;
|
19 | 22 |
|
20 | 23 | public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodegen {
|
@@ -117,6 +120,16 @@ public void processOpts() {
|
117 | 120 | addNpmPackageGeneration();
|
118 | 121 | }
|
119 | 122 |
|
| 123 | + protected void processMapSchema(CodegenModel codegenModel, String name, Schema schema) { |
| 124 | + final Map<String, Schema> properties = new HashMap<>(schema.getProperties()); |
| 125 | + if (schema.getAdditionalProperties() instanceof Schema) { |
| 126 | + properties.put("additionalProperties", (Schema) schema.getAdditionalProperties()); |
| 127 | + } else if (schema.getAdditionalProperties() instanceof Boolean) { |
| 128 | + properties.put("additionalProperties", new BooleanSchema()); |
| 129 | + } |
| 130 | + addVars(codegenModel, properties, schema.getRequired()); |
| 131 | + } |
| 132 | + |
120 | 133 | @Override
|
121 | 134 | public Map<String, Object> postProcessOperations(Map<String, Object> operations) {
|
122 | 135 | boolean hasImports = operations.get("hasImport") != null && Boolean.parseBoolean(operations.get("hasImport").toString());
|
|
0 commit comments