Permalink
Browse files

Add support for multiple inheritance (#1664)

* add all parent names

* clean up supportsInheritance

* fix npe

* fix allVars, fix test cases

* add more tests, remove comments

* update docker m2 cache dir, add more tests, fix mandatory

* update samples

* regenerate js spec files

* add logic to detect self reference

* add isSelfReference flag to codegen property

* add ruby tests for cat model

* remove debugging info

* fix JS allvars not have x-js-doctype

* update samples

* update js samples
  • Loading branch information...
wing328 committed Dec 14, 2018
1 parent 587bd56 commit 8c599ebf12483495f889cfc07ba6988d68b5e3ca
Showing with 829 additions and 448 deletions.
  1. +2 −0 modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java
  2. +68 −12 modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java
  3. +6 −0 modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java
  4. +138 −84 modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
  5. +3 −0 modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java
  6. +3 −0 ...i-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java
  7. +10 −0 ...s/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java
  8. +0 −1 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java
  9. +3 −0 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java
  10. +29 −0 modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java
  11. +2 −2 modules/openapi-generator/src/main/resources/typescript-angular/modelGeneric.mustache
  12. +156 −16 modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java
  13. +7 −0 modules/openapi-generator/src/test/resources/3_0/allOfMappingDuplicatedProperties.yaml
  14. +94 −0 modules/openapi-generator/src/test/resources/3_0/allOfMultiParent.yaml
  15. +1 −1 run-in-docker.sh
  16. +1 −1 samples/client/petstore/go/go-petstore/docs/Cat.md
  17. +1 −1 samples/client/petstore/go/go-petstore/docs/Dog.md
  18. +1 −1 samples/client/petstore/go/go-petstore/model_cat.go
  19. +1 −1 samples/client/petstore/go/go-petstore/model_dog.go
  20. +16 −16 samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs
  21. +10 −10 samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs
  22. +4 −4 samples/client/petstore/haskell-http-client/tests/Instances.hs
  23. +1 −1 samples/client/petstore/javascript-es6/.openapi-generator/VERSION
  24. +0 −4 samples/client/petstore/javascript-es6/docs/MapTest.md
  25. +1 −1 samples/client/petstore/javascript-es6/src/model/Cat.js
  26. +1 −1 samples/client/petstore/javascript-es6/src/model/Dog.js
  27. +1 −1 samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION
  28. +0 −4 samples/client/petstore/javascript-promise-es6/docs/MapTest.md
  29. +1 −1 samples/client/petstore/javascript-promise-es6/src/model/Cat.js
  30. +1 −1 samples/client/petstore/javascript-promise-es6/src/model/Dog.js
  31. +1 −1 samples/client/petstore/javascript-promise/.openapi-generator/VERSION
  32. +0 −4 samples/client/petstore/javascript-promise/docs/MapTest.md
  33. +1 −1 samples/client/petstore/javascript-promise/src/ApiClient.js
  34. +1 −1 samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js
  35. +1 −1 samples/client/petstore/javascript-promise/src/api/FakeApi.js
  36. +1 −1 samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js
  37. +1 −1 samples/client/petstore/javascript-promise/src/api/PetApi.js
  38. +1 −1 samples/client/petstore/javascript-promise/src/api/StoreApi.js
  39. +1 −1 samples/client/petstore/javascript-promise/src/api/UserApi.js
  40. +1 −1 samples/client/petstore/javascript-promise/src/index.js
  41. +1 −1 samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js
  42. +1 −1 samples/client/petstore/javascript-promise/src/model/Animal.js
  43. +1 −1 samples/client/petstore/javascript-promise/src/model/ApiResponse.js
  44. +1 −1 samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js
  45. +1 −1 samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js
  46. +1 −1 samples/client/petstore/javascript-promise/src/model/ArrayTest.js
  47. +1 −1 samples/client/petstore/javascript-promise/src/model/Capitalization.js
  48. +2 −2 samples/client/petstore/javascript-promise/src/model/Cat.js
  49. +1 −1 samples/client/petstore/javascript-promise/src/model/Category.js
  50. +1 −1 samples/client/petstore/javascript-promise/src/model/ClassModel.js
  51. +1 −1 samples/client/petstore/javascript-promise/src/model/Client.js
  52. +2 −2 samples/client/petstore/javascript-promise/src/model/Dog.js
  53. +1 −1 samples/client/petstore/javascript-promise/src/model/EnumArrays.js
  54. +1 −1 samples/client/petstore/javascript-promise/src/model/EnumClass.js
  55. +1 −1 samples/client/petstore/javascript-promise/src/model/EnumTest.js
  56. +1 −1 samples/client/petstore/javascript-promise/src/model/File.js
  57. +1 −1 samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js
  58. +1 −1 samples/client/petstore/javascript-promise/src/model/FormatTest.js
  59. +1 −1 samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js
  60. +1 −1 samples/client/petstore/javascript-promise/src/model/List.js
  61. +1 −1 samples/client/petstore/javascript-promise/src/model/MapTest.js
  62. +1 −1 samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js
  63. +1 −1 samples/client/petstore/javascript-promise/src/model/Model200Response.js
  64. +1 −1 samples/client/petstore/javascript-promise/src/model/ModelReturn.js
  65. +1 −1 samples/client/petstore/javascript-promise/src/model/Name.js
  66. +1 −1 samples/client/petstore/javascript-promise/src/model/NumberOnly.js
  67. +1 −1 samples/client/petstore/javascript-promise/src/model/Order.js
  68. +1 −1 samples/client/petstore/javascript-promise/src/model/OuterComposite.js
  69. +1 −1 samples/client/petstore/javascript-promise/src/model/OuterEnum.js
  70. +1 −1 samples/client/petstore/javascript-promise/src/model/Pet.js
  71. +1 −1 samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js
  72. +1 −1 samples/client/petstore/javascript-promise/src/model/SpecialModelName.js
  73. +1 −1 samples/client/petstore/javascript-promise/src/model/Tag.js
  74. +1 −1 samples/client/petstore/javascript-promise/src/model/User.js
  75. +1 −1 samples/client/petstore/javascript/.openapi-generator/VERSION
  76. +0 −4 samples/client/petstore/javascript/docs/MapTest.md
  77. +1 −1 samples/client/petstore/javascript/src/ApiClient.js
  78. +1 −1 samples/client/petstore/javascript/src/api/AnotherFakeApi.js
  79. +1 −1 samples/client/petstore/javascript/src/api/FakeApi.js
  80. +1 −1 samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js
  81. +1 −1 samples/client/petstore/javascript/src/api/PetApi.js
  82. +1 −1 samples/client/petstore/javascript/src/api/StoreApi.js
  83. +1 −1 samples/client/petstore/javascript/src/api/UserApi.js
  84. +1 −1 samples/client/petstore/javascript/src/index.js
  85. +1 −1 samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js
  86. +1 −1 samples/client/petstore/javascript/src/model/Animal.js
  87. +1 −1 samples/client/petstore/javascript/src/model/ApiResponse.js
  88. +1 −1 samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js
  89. +1 −1 samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js
  90. +1 −1 samples/client/petstore/javascript/src/model/ArrayTest.js
  91. +1 −1 samples/client/petstore/javascript/src/model/Capitalization.js
  92. +2 −2 samples/client/petstore/javascript/src/model/Cat.js
  93. +1 −1 samples/client/petstore/javascript/src/model/Category.js
  94. +1 −1 samples/client/petstore/javascript/src/model/ClassModel.js
  95. +1 −1 samples/client/petstore/javascript/src/model/Client.js
  96. +2 −2 samples/client/petstore/javascript/src/model/Dog.js
  97. +1 −1 samples/client/petstore/javascript/src/model/EnumArrays.js
  98. +1 −1 samples/client/petstore/javascript/src/model/EnumClass.js
  99. +1 −1 samples/client/petstore/javascript/src/model/EnumTest.js
  100. +1 −1 samples/client/petstore/javascript/src/model/File.js
  101. +1 −1 samples/client/petstore/javascript/src/model/FileSchemaTestClass.js
  102. +1 −1 samples/client/petstore/javascript/src/model/FormatTest.js
  103. +1 −1 samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js
  104. +1 −1 samples/client/petstore/javascript/src/model/List.js
  105. +1 −1 samples/client/petstore/javascript/src/model/MapTest.js
  106. +1 −1 samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js
  107. +1 −1 samples/client/petstore/javascript/src/model/Model200Response.js
  108. +1 −1 samples/client/petstore/javascript/src/model/ModelReturn.js
  109. +1 −1 samples/client/petstore/javascript/src/model/Name.js
  110. +1 −1 samples/client/petstore/javascript/src/model/NumberOnly.js
  111. +1 −1 samples/client/petstore/javascript/src/model/Order.js
  112. +1 −1 samples/client/petstore/javascript/src/model/OuterComposite.js
  113. +1 −1 samples/client/petstore/javascript/src/model/OuterEnum.js
  114. +1 −1 samples/client/petstore/javascript/src/model/Pet.js
  115. +1 −1 samples/client/petstore/javascript/src/model/ReadOnlyFirst.js
  116. +1 −1 samples/client/petstore/javascript/src/model/SpecialModelName.js
  117. +1 −1 samples/client/petstore/javascript/src/model/Tag.js
  118. +1 −1 samples/client/petstore/javascript/src/model/User.js
  119. +21 −6 samples/client/petstore/javascript/test/model/Cat.spec.js
  120. +21 −6 samples/client/petstore/javascript/test/model/Dog.spec.js
  121. +0 −2 samples/client/petstore/ruby/docs/Cat.md
  122. +0 −2 samples/client/petstore/ruby/docs/Dog.md
  123. +4 −29 samples/client/petstore/ruby/lib/petstore/models/cat.rb
  124. +4 −29 samples/client/petstore/ruby/lib/petstore/models/dog.rb
  125. +5 −9 samples/client/petstore/ruby/spec/models/cat_spec.rb
  126. +1 −0 samples/client/petstore/typescript-angular-v2/default/model/apiResponse.ts
  127. +1 −0 samples/client/petstore/typescript-angular-v2/default/model/category.ts
  128. +1 −0 samples/client/petstore/typescript-angular-v2/default/model/order.ts
  129. +1 −0 samples/client/petstore/typescript-angular-v2/default/model/pet.ts
  130. +1 −0 samples/client/petstore/typescript-angular-v2/default/model/tag.ts
  131. +1 −0 samples/client/petstore/typescript-angular-v2/default/model/user.ts
  132. +1 −0 samples/client/petstore/typescript-angular-v2/npm/model/apiResponse.ts
  133. +1 −0 samples/client/petstore/typescript-angular-v2/npm/model/category.ts
  134. +1 −0 samples/client/petstore/typescript-angular-v2/npm/model/order.ts
  135. +1 −0 samples/client/petstore/typescript-angular-v2/npm/model/pet.ts
  136. +1 −0 samples/client/petstore/typescript-angular-v2/npm/model/tag.ts
  137. +1 −0 samples/client/petstore/typescript-angular-v2/npm/model/user.ts
  138. +1 −0 samples/client/petstore/typescript-angular-v2/with-interfaces/model/apiResponse.ts
  139. +1 −0 samples/client/petstore/typescript-angular-v2/with-interfaces/model/category.ts
  140. +1 −0 samples/client/petstore/typescript-angular-v2/with-interfaces/model/order.ts
  141. +1 −0 samples/client/petstore/typescript-angular-v2/with-interfaces/model/pet.ts
  142. +1 −0 samples/client/petstore/typescript-angular-v2/with-interfaces/model/tag.ts
  143. +1 −0 samples/client/petstore/typescript-angular-v2/with-interfaces/model/user.ts
  144. +1 −0 samples/client/petstore/typescript-angular-v4.3/npm/model/apiResponse.ts
  145. +1 −0 samples/client/petstore/typescript-angular-v4.3/npm/model/category.ts
  146. +1 −0 samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts
  147. +1 −0 samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts
  148. +1 −0 samples/client/petstore/typescript-angular-v4.3/npm/model/tag.ts
  149. +1 −0 samples/client/petstore/typescript-angular-v4.3/npm/model/user.ts
  150. +1 −0 samples/client/petstore/typescript-angular-v4/npm/model/apiResponse.ts
  151. +1 −0 samples/client/petstore/typescript-angular-v4/npm/model/category.ts
  152. +1 −0 samples/client/petstore/typescript-angular-v4/npm/model/order.ts
  153. +1 −0 samples/client/petstore/typescript-angular-v4/npm/model/pet.ts
  154. +1 −0 samples/client/petstore/typescript-angular-v4/npm/model/tag.ts
  155. +1 −0 samples/client/petstore/typescript-angular-v4/npm/model/user.ts
  156. +1 −0 ...es/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/apiResponse.ts
  157. +1 −0 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/category.ts
  158. +1 −0 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/order.ts
  159. +1 −0 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/pet.ts
  160. +1 −0 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/tag.ts
  161. +1 −0 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/user.ts
  162. +1 −0 ...s/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/apiResponse.ts
  163. +1 −0 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/category.ts
  164. +1 −0 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/order.ts
  165. +1 −0 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/pet.ts
  166. +1 −0 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/tag.ts
  167. +1 −0 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/user.ts
  168. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/apiResponse.ts
  169. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/category.ts
  170. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/order.ts
  171. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/pet.ts
  172. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/tag.ts
  173. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/user.ts
  174. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/apiResponse.ts
  175. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/category.ts
  176. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/order.ts
  177. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/pet.ts
  178. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/tag.ts
  179. +1 −0 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/user.ts
  180. +1 −0 ...es/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/apiResponse.ts
  181. +1 −0 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/category.ts
  182. +1 −0 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/order.ts
  183. +1 −0 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/pet.ts
  184. +1 −0 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/tag.ts
  185. +1 −0 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/user.ts
  186. +1 −0 ...s/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/apiResponse.ts
  187. +1 −0 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/category.ts
  188. +1 −0 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/order.ts
  189. +1 −0 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/pet.ts
  190. +1 −0 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/tag.ts
  191. +1 −0 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/user.ts
  192. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/apiResponse.ts
  193. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/category.ts
  194. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/order.ts
  195. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/pet.ts
  196. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/tag.ts
  197. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/user.ts
  198. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/apiResponse.ts
  199. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/category.ts
  200. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/order.ts
  201. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/pet.ts
  202. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/tag.ts
  203. +1 −0 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/user.ts
  204. +0 −2 samples/openapi3/client/petstore/ruby/docs/Cat.md
  205. +0 −2 samples/openapi3/client/petstore/ruby/docs/Dog.md
  206. +4 −29 samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb
  207. +4 −29 samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb
  208. +4 −9 samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb
  209. +4 −4 samples/schema/petstore/mysql/mysql_schema.sql
  210. +3 −3 samples/server/petstore/php-slim/lib/Model/Cat.php
  211. +3 −3 samples/server/petstore/php-slim/lib/Model/Dog.php
  212. +6 −6 samples/server/petstore/php-ze-ph/src/App/DTO/Cat.php
  213. +6 −6 samples/server/petstore/php-ze-ph/src/App/DTO/Dog.php
  214. +10 −10 .../server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs
@@ -171,6 +171,8 @@

void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map<String, List<CodegenOperation>> operations);

Map<String, Object> updateAllModels(Map<String, Object> objs);

Map<String, Object> postProcessAllModels(Map<String, Object> objs);

Map<String, Object> postProcessModels(Map<String, Object> objs);
@@ -22,11 +22,13 @@
import java.util.*;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;

@JsonIgnoreProperties({"parentModel", "interfaceModels"})
public class CodegenModel {
public String parent, parentSchema;
public List<String> interfaces;
public List<String> allParents;

// References to parent and interface CodegenModels. Only set when code generator supports inheritance.
public CodegenModel parentModel;
@@ -46,18 +48,18 @@
public String arrayModelType;
public boolean isAlias; // Is this effectively an alias of another simple type
public boolean isString, isInteger;
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>();
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>(); // all properties (without parent's properties)
public List<CodegenProperty> allVars = new ArrayList<CodegenProperty>(); // all properties (with parent's properties)
public List<CodegenProperty> requiredVars = new ArrayList<CodegenProperty>(); // a list of required properties
public List<CodegenProperty> optionalVars = new ArrayList<CodegenProperty>(); // a list of optional properties
public List<CodegenProperty> readOnlyVars = new ArrayList<CodegenProperty>(); // a list of read-only properties
public List<CodegenProperty> readWriteVars = new ArrayList<CodegenProperty>(); // a list of properties for read, write
public List<CodegenProperty> allVars = new ArrayList<CodegenProperty>();
public List<CodegenProperty> parentVars = new ArrayList<CodegenProperty>();
public Map<String, Object> allowableValues;

// Sorted sets of required parameters.
public Set<String> mandatory = new TreeSet<String>();
public Set<String> allMandatory;
public Set<String> mandatory = new TreeSet<String>(); // without parent's required properties
public Set<String> allMandatory = new TreeSet<String>(); // with parent's required properties

public Set<String> imports = new TreeSet<String>();
public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, hasOptional, isArrayModel, hasChildren, isMapModel;
@@ -69,16 +71,59 @@
//The type of the value from additional properties. Used in map like objects.
public String additionalPropertiesType;

{
// By default these are the same collections. Where the code generator supports inheritance, composed models
// store the complete closure of owned and inherited properties in allVars and allMandatory.
allVars = vars;
allMandatory = mandatory;
}

@Override
public String toString() {
return String.format(Locale.ROOT, "%s(%s)", name, classname);
return new ToStringBuilder(this)
.append("parent", parent)
.append("parentSchema", parentSchema)
.append("interfaces", interfaces)
.append("parentModel", parentModel)
.append("interfaceModels", interfaceModels)
.append("children", children)
.append("name", name)
.append("classname", classname)
.append("title", title)
.append("description", description)
.append("classVarName", classVarName)
.append("modelJson", modelJson)
.append("dataType", dataType)
.append("xmlPrefix", xmlPrefix)
.append("xmlNamespace", xmlNamespace)
.append("xmlName", xmlName)
.append("classFilename", classFilename)
.append("unescapedDescription", unescapedDescription)
.append("discriminator", discriminator)
.append("defaultValue", defaultValue)
.append("arrayModelType", arrayModelType)
.append("isAlias", isAlias)
.append("isString", isString)
.append("isInteger", isInteger)
.append("vars", vars)
.append("requiredVars", requiredVars)
.append("optionalVars", optionalVars)
.append("readOnlyVars", readOnlyVars)
.append("readWriteVars", readWriteVars)
.append("allVars", allVars)
.append("parentVars", parentVars)
.append("allowableValues", allowableValues)
.append("mandatory", mandatory)
.append("allMandatory", allMandatory)
.append("imports", imports)
.append("hasVars", hasVars)
.append("emptyVars", emptyVars)
.append("hasMoreModels", hasMoreModels)
.append("hasEnums", hasEnums)
.append("isEnum", isEnum)
.append("hasRequired", hasRequired)
.append("hasOptional", hasOptional)
.append("isArrayModel", isArrayModel)
.append("hasChildren", hasChildren)
.append("isMapModel", isMapModel)
.append("hasOnlyReadOnly", hasOnlyReadOnly)
.append("externalDocumentation", externalDocumentation)
.append("vendorExtensions", vendorExtensions)
.append("additionalPropertiesType", additionalPropertiesType)
.toString();
}

@Override
@@ -94,6 +139,8 @@ public boolean equals(Object o) {
return false;
if (interfaces != null ? !interfaces.equals(that.interfaces) : that.interfaces != null)
return false;
if (allParents != null ? !allParents.equals(that.allParents) : that.allParents != null)
return false;
if (parentModel != null ? !parentModel.equals(that.parentModel) : that.parentModel != null)
return false;
if (interfaceModels != null ? !interfaceModels.equals(that.interfaceModels) : that.interfaceModels != null)
@@ -169,6 +216,7 @@ public int hashCode() {
int result = parent != null ? parent.hashCode() : 0;
result = 31 * result + (parentSchema != null ? parentSchema.hashCode() : 0);
result = 31 * result + (interfaces != null ? interfaces.hashCode() : 0);
result = 31 * result + (allParents != null ? allParents.hashCode() : 0);
result = 31 * result + (parentModel != null ? parentModel.hashCode() : 0);
result = 31 * result + (interfaceModels != null ? interfaceModels.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
@@ -226,10 +274,18 @@ public void setParentSchema(String parentSchema) {
return interfaces;
}

public List<String> getAllParents() {
return allParents;
}

public void setInterfaces(List<String> interfaces) {
this.interfaces = interfaces;
}

public void setAllParents(List<String> allParents) {
this.allParents = allParents;
}

public CodegenModel getParentModel() {
return parentModel;
}
@@ -61,6 +61,7 @@
public boolean isReadOnly;
public boolean isWriteOnly;
public boolean isNullable;
public boolean isSelfReference;
public List<String> _enum;
public Map<String, Object> allowableValues;
public CodegenProperty items;
@@ -439,6 +440,7 @@ public int hashCode() {
result = prime * result + ((isReadOnly ? 13 : 31));
result = prime * result + ((isWriteOnly ? 13 : 31));
result = prime * result + ((isNullable ? 13 : 31));
result = prime * result + ((isSelfReference ? 13 : 31));
result = prime * result + ((items == null) ? 0 : items.hashCode());
result = prime * result + ((mostInnerItems == null) ? 0 : mostInnerItems.hashCode());
result = prime * result + ((jsonSchema == null) ? 0 : jsonSchema.hashCode());
@@ -597,6 +599,9 @@ public boolean equals(Object obj) {
if (this.isNullable != other.isNullable) {
return false;
}
if (this.isSelfReference != other.isSelfReference ) {
return false;
}
if (this._enum != other._enum && (this._enum == null || !this._enum.equals(other._enum))) {
return false;
}
@@ -790,6 +795,7 @@ public CodegenProperty clone() {
", isReadOnly=" + isReadOnly +
", isWriteOnly=" + isWriteOnly +
", isNullable=" + isNullable +
", isSelfReference=" + isSelfReference +
", _enum=" + _enum +
", allowableValues=" + allowableValues +
", items=" + items +
Oops, something went wrong.

0 comments on commit 8c599eb

Please sign in to comment.