forked from loafle/openapi-generator-original
Support models with multi-level hierarchy (via roxspring) (#4503)
* Example of broken multi-level hierarchy * Support for multiple levels of hierarchy in model objects * Support for multiple levels of hierarchy in generators * Regenerated samples * Temporarily skip scalaz sample verification, which is having issue with Java version in CI container * Re-enable scalaz in verify samples Co-authored-by: Rob Oxspring <roxspring@imapmail.org>
This commit is contained in:
committed by
William Cheng
parent
daec02b8c5
commit
376e419d0b
@@ -26,6 +26,8 @@ import ApiResponse from './model/ApiResponse';
|
||||
import ArrayOfArrayOfNumberOnly from './model/ArrayOfArrayOfNumberOnly';
|
||||
import ArrayOfNumberOnly from './model/ArrayOfNumberOnly';
|
||||
import ArrayTest from './model/ArrayTest';
|
||||
import BigCat from './model/BigCat';
|
||||
import BigCatAllOf from './model/BigCatAllOf';
|
||||
import Capitalization from './model/Capitalization';
|
||||
import Cat from './model/Cat';
|
||||
import CatAllOf from './model/CatAllOf';
|
||||
@@ -183,6 +185,18 @@ export {
|
||||
*/
|
||||
ArrayTest,
|
||||
|
||||
/**
|
||||
* The BigCat model constructor.
|
||||
* @property {module:model/BigCat}
|
||||
*/
|
||||
BigCat,
|
||||
|
||||
/**
|
||||
* The BigCatAllOf model constructor.
|
||||
* @property {module:model/BigCatAllOf}
|
||||
*/
|
||||
BigCatAllOf,
|
||||
|
||||
/**
|
||||
* The Capitalization model constructor.
|
||||
* @property {module:model/Capitalization}
|
||||
|
||||
132
samples/client/petstore/javascript-es6/src/model/BigCat.js
Normal file
132
samples/client/petstore/javascript-es6/src/model/BigCat.js
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
import ApiClient from '../ApiClient';
|
||||
import BigCatAllOf from './BigCatAllOf';
|
||||
import Cat from './Cat';
|
||||
|
||||
/**
|
||||
* The BigCat model module.
|
||||
* @module model/BigCat
|
||||
* @version 1.0.0
|
||||
*/
|
||||
class BigCat {
|
||||
/**
|
||||
* Constructs a new <code>BigCat</code>.
|
||||
* @alias module:model/BigCat
|
||||
* @extends module:model/Cat
|
||||
* @implements module:model/Cat
|
||||
* @implements module:model/BigCatAllOf
|
||||
* @param className {String}
|
||||
*/
|
||||
constructor(className) {
|
||||
Cat.initialize(this, className);BigCatAllOf.initialize(this);
|
||||
BigCat.initialize(this, className);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the fields of this object.
|
||||
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
||||
* Only for internal use.
|
||||
*/
|
||||
static initialize(obj, className) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a <code>BigCat</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {module:model/BigCat} obj Optional instance to populate.
|
||||
* @return {module:model/BigCat} The populated <code>BigCat</code> instance.
|
||||
*/
|
||||
static constructFromObject(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new BigCat();
|
||||
Cat.constructFromObject(data, obj);
|
||||
Cat.constructFromObject(data, obj);
|
||||
BigCatAllOf.constructFromObject(data, obj);
|
||||
|
||||
if (data.hasOwnProperty('kind')) {
|
||||
obj['kind'] = ApiClient.convertToType(data['kind'], 'String');
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {module:model/BigCat.KindEnum} kind
|
||||
*/
|
||||
BigCat.prototype['kind'] = undefined;
|
||||
|
||||
|
||||
// Implement Cat interface:
|
||||
/**
|
||||
* @member {String} className
|
||||
*/
|
||||
Cat.prototype['className'] = undefined;
|
||||
/**
|
||||
* @member {String} color
|
||||
* @default 'red'
|
||||
*/
|
||||
Cat.prototype['color'] = 'red';
|
||||
/**
|
||||
* @member {Boolean} declawed
|
||||
*/
|
||||
Cat.prototype['declawed'] = undefined;
|
||||
// Implement BigCatAllOf interface:
|
||||
/**
|
||||
* @member {module:model/BigCatAllOf.KindEnum} kind
|
||||
*/
|
||||
BigCatAllOf.prototype['kind'] = undefined;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Allowed values for the <code>kind</code> property.
|
||||
* @enum {String}
|
||||
* @readonly
|
||||
*/
|
||||
BigCat['KindEnum'] = {
|
||||
|
||||
/**
|
||||
* value: "lions"
|
||||
* @const
|
||||
*/
|
||||
"lions": "lions",
|
||||
|
||||
/**
|
||||
* value: "tigers"
|
||||
* @const
|
||||
*/
|
||||
"tigers": "tigers",
|
||||
|
||||
/**
|
||||
* value: "leopards"
|
||||
* @const
|
||||
*/
|
||||
"leopards": "leopards",
|
||||
|
||||
/**
|
||||
* value: "jaguars"
|
||||
* @const
|
||||
*/
|
||||
"jaguars": "jaguars"
|
||||
};
|
||||
|
||||
|
||||
|
||||
export default BigCat;
|
||||
|
||||
104
samples/client/petstore/javascript-es6/src/model/BigCatAllOf.js
Normal file
104
samples/client/petstore/javascript-es6/src/model/BigCatAllOf.js
Normal file
@@ -0,0 +1,104 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
import ApiClient from '../ApiClient';
|
||||
|
||||
/**
|
||||
* The BigCatAllOf model module.
|
||||
* @module model/BigCatAllOf
|
||||
* @version 1.0.0
|
||||
*/
|
||||
class BigCatAllOf {
|
||||
/**
|
||||
* Constructs a new <code>BigCatAllOf</code>.
|
||||
* @alias module:model/BigCatAllOf
|
||||
*/
|
||||
constructor() {
|
||||
|
||||
BigCatAllOf.initialize(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the fields of this object.
|
||||
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
||||
* Only for internal use.
|
||||
*/
|
||||
static initialize(obj) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a <code>BigCatAllOf</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {module:model/BigCatAllOf} obj Optional instance to populate.
|
||||
* @return {module:model/BigCatAllOf} The populated <code>BigCatAllOf</code> instance.
|
||||
*/
|
||||
static constructFromObject(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new BigCatAllOf();
|
||||
|
||||
if (data.hasOwnProperty('kind')) {
|
||||
obj['kind'] = ApiClient.convertToType(data['kind'], 'String');
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {module:model/BigCatAllOf.KindEnum} kind
|
||||
*/
|
||||
BigCatAllOf.prototype['kind'] = undefined;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Allowed values for the <code>kind</code> property.
|
||||
* @enum {String}
|
||||
* @readonly
|
||||
*/
|
||||
BigCatAllOf['KindEnum'] = {
|
||||
|
||||
/**
|
||||
* value: "lions"
|
||||
* @const
|
||||
*/
|
||||
"lions": "lions",
|
||||
|
||||
/**
|
||||
* value: "tigers"
|
||||
* @const
|
||||
*/
|
||||
"tigers": "tigers",
|
||||
|
||||
/**
|
||||
* value: "leopards"
|
||||
* @const
|
||||
*/
|
||||
"leopards": "leopards",
|
||||
|
||||
/**
|
||||
* value: "jaguars"
|
||||
* @const
|
||||
*/
|
||||
"jaguars": "jaguars"
|
||||
};
|
||||
|
||||
|
||||
|
||||
export default BigCatAllOf;
|
||||
|
||||
Reference in New Issue
Block a user