diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 7f09e70dc65..f57c6f66fa3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1535,36 +1535,6 @@ public class DefaultCodegen implements CodegenConfig { return m; } - /** - * Recursively look for a discriminator in the interface tree - * - * @param schema composed schema - * @param allDefinitions all schema defintion - * @return true if it's a discriminator - */ - private boolean isDiscriminatorInInterfaceTree(ComposedSchema schema, Map allDefinitions) { - if (schema == null || allDefinitions == null || allDefinitions.isEmpty()) { - return false; - } - if (schema.getDiscriminator() != null) { - return true; - } - final List interfaces = getInterfaces(schema); - if (interfaces == null) { - return false; - } - for (Schema interfaceSchema : interfaces) { - if (interfaceSchema.getDiscriminator() != null) { - return true; - } - // TODO revise the logic below - if (interfaceSchema instanceof ComposedSchema) { - return isDiscriminatorInInterfaceTree((ComposedSchema) interfaceSchema, allDefinitions); - } - } - return false; - } - protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { addParentContainer(codegenModel, codegenModel.name, schema); } @@ -2958,20 +2928,6 @@ public class DefaultCodegen implements CodegenConfig { return objs; } - private static Map addHasMore(Map objs) { - if (objs != null) { - for (int i = 0; i < objs.size() - 1; i++) { - if (i > 0) { - objs.put("secondaryParam", true); - } - if (i < objs.size() - 1) { - objs.put("hasMore", true); - } - } - } - return objs; - } - /** * Add operation to group * @@ -3989,19 +3945,6 @@ public class DefaultCodegen implements CodegenConfig { return produces; } - protected Schema detectParent(ComposedSchema composedSchema, Map allSchemas) { - if (composedSchema.getAllOf() != null && !composedSchema.getAllOf().isEmpty()) { - Schema schema = composedSchema.getAllOf().get(0); - String ref = schema.get$ref(); - if (StringUtils.isBlank(ref)) { - return null; - } - ref = ModelUtils.getSimpleRef(ref); - return allSchemas.get(ref); - } - return null; - } - protected String getParentName(ComposedSchema composedSchema, Map allSchemas) { if (composedSchema.getAllOf() != null && !composedSchema.getAllOf().isEmpty()) { Schema schema = composedSchema.getAllOf().get(0); @@ -4033,12 +3976,6 @@ public class DefaultCodegen implements CodegenConfig { } } - // TODO do we still need the methdo below? - protected static boolean hasSchemaProperties(Schema schema) { - final Object additionalProperties = schema.getAdditionalProperties(); - return additionalProperties != null && additionalProperties instanceof Schema; - } - public CodegenType getTag() { return null; } @@ -4362,10 +4299,6 @@ public class DefaultCodegen implements CodegenConfig { return codegenParameter; } - protected void addOption(String key, String description) { - addOption(key, description, null); - } - protected void addOption(String key, String description, String defaultValue) { CliOption option = new CliOption(key, description); if (defaultValue != null)