forked from loafle/openapi-generator-original
Merge pull request #2126 from delenius/enum-exports
Correct exporting of enum classes
This commit is contained in:
commit
6ecf018f69
@ -1,17 +1,10 @@
|
|||||||
|
|
||||||
//export module
|
|
||||||
if ( typeof define === "function" && define.amd ) {
|
|
||||||
define('{{datatypeWithEnum}}', [], function() {
|
|
||||||
return {{datatypeWithEnum}};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var {{datatypeWithEnum}} = {
|
var {{datatypeWithEnum}} = {
|
||||||
{{#allowableValues}}{{#enumVars}}
|
{{#allowableValues}}{{#enumVars}}
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
*/
|
*/
|
||||||
{{name}}: "{{value}}"{{^-last}},
|
{{name}}: "{{value}}"{{^-last}},
|
||||||
{{/-last}}{{/enumVars}}{{/allowableValues}}
|
{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||||
|
};
|
||||||
|
|
||||||
}
|
{{classname}}.{{datatypeWithEnum}} = {{datatypeWithEnum}};
|
||||||
|
@ -14,11 +14,7 @@
|
|||||||
}
|
}
|
||||||
}(this, function(module, ApiClient{{#imports}}, {{import}}{{/imports}}) {
|
}(this, function(module, ApiClient{{#imports}}, {{import}}{{/imports}}) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
{{#models}}{{#model}}
|
{{#models}}{{#model}}
|
||||||
{{#vars}}{{#isEnum}}{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}}
|
|
||||||
{{>enumClass}}{{/items}}*/{{/items.isEnum}}{{/vars}}
|
|
||||||
|
|
||||||
{{#description}}/**
|
{{#description}}/**
|
||||||
* {{description}}
|
* {{description}}
|
||||||
**/{{/description}}
|
**/{{/description}}
|
||||||
@ -74,6 +70,9 @@
|
|||||||
return JSON.stringify(this);
|
return JSON.stringify(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{#vars}}{{#isEnum}}{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}}
|
||||||
|
{{>enumClass}}{{/items}}*/{{/items.isEnum}}{{/vars}}
|
||||||
|
|
||||||
if (module) {
|
if (module) {
|
||||||
module.{{classname}} = {{classname}};
|
module.{{classname}} = {{classname}};
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,8 @@
|
|||||||
}
|
}
|
||||||
}(this, function(module, ApiClient) {
|
}(this, function(module, ApiClient) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var Category = function Category() {
|
var Category = function Category() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,6 +83,8 @@
|
|||||||
return JSON.stringify(this);
|
return JSON.stringify(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (module) {
|
if (module) {
|
||||||
module.Category = Category;
|
module.Category = Category;
|
||||||
}
|
}
|
||||||
|
@ -14,37 +14,8 @@
|
|||||||
}
|
}
|
||||||
}(this, function(module, ApiClient) {
|
}(this, function(module, ApiClient) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//export module
|
|
||||||
if ( typeof define === "function" && define.amd ) {
|
|
||||||
define('StatusEnum', [], function() {
|
|
||||||
return StatusEnum;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var StatusEnum = {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
PLACED: "placed",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
APPROVED: "approved",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
DELIVERED: "delivered"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var Order = function Order() {
|
var Order = function Order() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -207,6 +178,27 @@ var StatusEnum = {
|
|||||||
return JSON.stringify(this);
|
return JSON.stringify(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var StatusEnum = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
PLACED: "placed",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
APPROVED: "approved",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
DELIVERED: "delivered"
|
||||||
|
};
|
||||||
|
|
||||||
|
Order.StatusEnum = StatusEnum;
|
||||||
|
|
||||||
|
|
||||||
if (module) {
|
if (module) {
|
||||||
module.Order = Order;
|
module.Order = Order;
|
||||||
}
|
}
|
||||||
|
@ -14,37 +14,8 @@
|
|||||||
}
|
}
|
||||||
}(this, function(module, ApiClient, Category, Tag) {
|
}(this, function(module, ApiClient, Category, Tag) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//export module
|
|
||||||
if ( typeof define === "function" && define.amd ) {
|
|
||||||
define('StatusEnum', [], function() {
|
|
||||||
return StatusEnum;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var StatusEnum = {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
AVAILABLE: "available",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
PENDING: "pending",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
SOLD: "sold"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var Pet = function Pet(photoUrls, name) {
|
var Pet = function Pet(photoUrls, name) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -209,6 +180,27 @@ var StatusEnum = {
|
|||||||
return JSON.stringify(this);
|
return JSON.stringify(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var StatusEnum = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
AVAILABLE: "available",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
PENDING: "pending",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
SOLD: "sold"
|
||||||
|
};
|
||||||
|
|
||||||
|
Pet.StatusEnum = StatusEnum;
|
||||||
|
|
||||||
|
|
||||||
if (module) {
|
if (module) {
|
||||||
module.Pet = Pet;
|
module.Pet = Pet;
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,8 @@
|
|||||||
}
|
}
|
||||||
}(this, function(module, ApiClient) {
|
}(this, function(module, ApiClient) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var Tag = function Tag() {
|
var Tag = function Tag() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,6 +83,8 @@
|
|||||||
return JSON.stringify(this);
|
return JSON.stringify(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (module) {
|
if (module) {
|
||||||
module.Tag = Tag;
|
module.Tag = Tag;
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,8 @@
|
|||||||
}
|
}
|
||||||
}(this, function(module, ApiClient) {
|
}(this, function(module, ApiClient) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var User = function User() {
|
var User = function User() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -227,6 +224,8 @@
|
|||||||
return JSON.stringify(this);
|
return JSON.stringify(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (module) {
|
if (module) {
|
||||||
module.User = User;
|
module.User = User;
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,8 @@
|
|||||||
}
|
}
|
||||||
}(this, function(module, ApiClient) {
|
}(this, function(module, ApiClient) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var Category = function Category() {
|
var Category = function Category() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,6 +83,8 @@
|
|||||||
return JSON.stringify(this);
|
return JSON.stringify(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (module) {
|
if (module) {
|
||||||
module.Category = Category;
|
module.Category = Category;
|
||||||
}
|
}
|
||||||
|
@ -14,37 +14,8 @@
|
|||||||
}
|
}
|
||||||
}(this, function(module, ApiClient) {
|
}(this, function(module, ApiClient) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//export module
|
|
||||||
if ( typeof define === "function" && define.amd ) {
|
|
||||||
define('StatusEnum', [], function() {
|
|
||||||
return StatusEnum;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var StatusEnum = {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
PLACED: "placed",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
APPROVED: "approved",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
DELIVERED: "delivered"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var Order = function Order() {
|
var Order = function Order() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -207,6 +178,27 @@ var StatusEnum = {
|
|||||||
return JSON.stringify(this);
|
return JSON.stringify(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var StatusEnum = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
PLACED: "placed",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
APPROVED: "approved",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
DELIVERED: "delivered"
|
||||||
|
};
|
||||||
|
|
||||||
|
Order.StatusEnum = StatusEnum;
|
||||||
|
|
||||||
|
|
||||||
if (module) {
|
if (module) {
|
||||||
module.Order = Order;
|
module.Order = Order;
|
||||||
}
|
}
|
||||||
|
@ -14,37 +14,8 @@
|
|||||||
}
|
}
|
||||||
}(this, function(module, ApiClient, Category, Tag) {
|
}(this, function(module, ApiClient, Category, Tag) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//export module
|
|
||||||
if ( typeof define === "function" && define.amd ) {
|
|
||||||
define('StatusEnum', [], function() {
|
|
||||||
return StatusEnum;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var StatusEnum = {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
AVAILABLE: "available",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
PENDING: "pending",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
*/
|
|
||||||
SOLD: "sold"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var Pet = function Pet(photoUrls, name) {
|
var Pet = function Pet(photoUrls, name) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -209,6 +180,27 @@ var StatusEnum = {
|
|||||||
return JSON.stringify(this);
|
return JSON.stringify(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var StatusEnum = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
AVAILABLE: "available",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
PENDING: "pending",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
SOLD: "sold"
|
||||||
|
};
|
||||||
|
|
||||||
|
Pet.StatusEnum = StatusEnum;
|
||||||
|
|
||||||
|
|
||||||
if (module) {
|
if (module) {
|
||||||
module.Pet = Pet;
|
module.Pet = Pet;
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,8 @@
|
|||||||
}
|
}
|
||||||
}(this, function(module, ApiClient) {
|
}(this, function(module, ApiClient) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var Tag = function Tag() {
|
var Tag = function Tag() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,6 +83,8 @@
|
|||||||
return JSON.stringify(this);
|
return JSON.stringify(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (module) {
|
if (module) {
|
||||||
module.Tag = Tag;
|
module.Tag = Tag;
|
||||||
}
|
}
|
||||||
|
@ -14,11 +14,8 @@
|
|||||||
}
|
}
|
||||||
}(this, function(module, ApiClient) {
|
}(this, function(module, ApiClient) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var User = function User() {
|
var User = function User() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -227,6 +224,8 @@
|
|||||||
return JSON.stringify(this);
|
return JSON.stringify(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (module) {
|
if (module) {
|
||||||
module.User = User;
|
module.User = User;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user