Skip to content

Commit ba85a53

Browse files
authored
Merge pull request #10003 from swagger-api/composed_refactoring
Composed refactoring
2 parents 169c978 + 663e9d3 commit ba85a53

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/v3/CodegenModel.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class CodegenModel extends CodegenObject {
4242

4343
public Set<String> imports = new TreeSet<String>();
4444
public boolean emptyVars;
45+
public boolean isComposedModel;
4546
public ExternalDocumentation externalDocumentation;
4647

4748
//The type of the value from additional properties. Used in map like objects.
@@ -471,4 +472,12 @@ public String getAdditionalPropertiesType() {
471472
public void setAdditionalPropertiesType(String additionalPropertiesType) {
472473
this.additionalPropertiesType = additionalPropertiesType;
473474
}
475+
476+
public boolean getIsComposedModel() {
477+
return isComposedModel;
478+
}
479+
480+
public void setIsComposedModel(boolean isComposedModel) {
481+
this.isComposedModel = isComposedModel;
482+
}
474483
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package io.swagger.codegen.v3;
2+
3+
import io.swagger.v3.oas.models.media.Schema;
4+
5+
import java.util.List;
6+
7+
public interface ISchemaHandler {
8+
9+
/**
10+
* check if there is any composed schema in models or properties. And create codegen model objects if it's required.
11+
* @param codegenModel
12+
* @param schema
13+
*/
14+
void proccessComposedSchemas(CodegenModel codegenModel, Schema schema);
15+
16+
/**
17+
* retrieve a list of codegen models created from composed schemas found.
18+
* @return
19+
*/
20+
List<CodegenModel> getModels();
21+
}

0 commit comments

Comments
 (0)