JavaScript client: fix exporting of outer enum model

This commit is contained in:
xhh 2016-05-06 17:36:07 +08:00
parent db65a1526f
commit 3dbab1b893
4 changed files with 2 additions and 147 deletions

View File

@ -5,7 +5,7 @@
* @readonly
*/
{{/emitJSDoc}}
exports.{{classname}} = {
var exports = {
{{#allowableValues}}
{{#values}}
{{#emitJSDoc}}

View File

@ -1,13 +0,0 @@
# SwaggerPetstore.InlineResponse200
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**tags** | [**[Tag]**](Tag.md) | | [optional]
**id** | **Integer** | |
**category** | **Object** | | [optional]
**status** | **String** | pet status in the store | [optional]
**name** | **String** | | [optional]
**photoUrls** | **[String]** | | [optional]

View File

@ -21,7 +21,7 @@
* @enum {}
* @readonly
*/
exports.EnumClass = {
var exports = {
/**
* value: _abc
* @const

View File

@ -1,132 +0,0 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Tag'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Tag'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.InlineResponse200 = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Tag);
}
}(this, function(ApiClient, Tag) {
'use strict';
/**
* The InlineResponse200 model module.
* @module model/InlineResponse200
* @version 1.0.0
*/
/**
* Constructs a new <code>InlineResponse200</code>.
* @alias module:model/InlineResponse200
* @class
* @param id
*/
var exports = function(id) {
this['id'] = id;
};
/**
* Constructs a <code>InlineResponse200</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/InlineResponse200} obj Optional instance to populate.
* @return {module:model/InlineResponse200} The populated <code>InlineResponse200</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('tags')) {
obj['tags'] = ApiClient.convertToType(data['tags'], [Tag]);
}
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
}
if (data.hasOwnProperty('category')) {
obj['category'] = ApiClient.convertToType(data['category'], Object);
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('photoUrls')) {
obj['photoUrls'] = ApiClient.convertToType(data['photoUrls'], ['String']);
}
}
return obj;
}
/**
* @member {Array.<module:model/Tag>} tags
*/
exports.prototype['tags'] = undefined;
/**
* @member {Integer} id
*/
exports.prototype['id'] = undefined;
/**
* @member {Object} category
*/
exports.prototype['category'] = undefined;
/**
* pet status in the store
* @member {module:model/InlineResponse200.StatusEnum} status
*/
exports.prototype['status'] = undefined;
/**
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* @member {Array.<String>} photoUrls
*/
exports.prototype['photoUrls'] = undefined;
/**
* Allowed values for the <code>status</code> property.
* @enum {String}
* @readonly
*/
exports.StatusEnum = {
/**
* value: available
* @const
*/
AVAILABLE: "available",
/**
* value: pending
* @const
*/
PENDING: "pending",
/**
* value: sold
* @const
*/
SOLD: "sold"
};
return exports;
}));