Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ if ( typeof define === "function" && define.amd ) {
});
}

var {{datatypeWithEnum}} = function {{datatypeWithEnum}}() {
var self = this;

var {{datatypeWithEnum}} = {
{{#allowableValues}}{{#enumVars}}
/**
* @const
*/
self.{{name}} = "{{value}}"{{^-last}},
{{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}
{{name}}: "{{value}}"{{^-last}},
{{/-last}}{{/enumVars}}{{/allowableValues}}

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
}



/**
* @return {Integer}
**/
Expand Down Expand Up @@ -78,6 +79,7 @@
this['name'] = name;
}



Category.prototype.toJson = function() {
return JSON.stringify(this);
Expand Down
12 changes: 6 additions & 6 deletions samples/client/petstore/javascript-promise/src/model/Order.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,22 @@ if ( typeof define === "function" && define.amd ) {
});
}

var StatusEnum = function StatusEnum() {
var self = this;

var StatusEnum = {

/**
* @const
*/
self.PLACED = "placed",
PLACED: "placed",

/**
* @const
*/
self.APPROVED = "approved",
APPROVED: "approved",

/**
* @const
*/
self.DELIVERED = "delivered";
DELIVERED: "delivered"

}

Expand Down Expand Up @@ -115,6 +113,7 @@ var StatusEnum = function StatusEnum() {
}



/**
* @return {Integer}
**/
Expand Down Expand Up @@ -201,6 +200,7 @@ var StatusEnum = function StatusEnum() {
this['complete'] = complete;
}



Order.prototype.toJson = function() {
return JSON.stringify(this);
Expand Down
12 changes: 6 additions & 6 deletions samples/client/petstore/javascript-promise/src/model/Pet.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,22 @@ if ( typeof define === "function" && define.amd ) {
});
}

var StatusEnum = function StatusEnum() {
var self = this;

var StatusEnum = {

/**
* @const
*/
self.AVAILABLE = "available",
AVAILABLE: "available",

/**
* @const
*/
self.PENDING = "pending",
PENDING: "pending",

/**
* @const
*/
self.SOLD = "sold";
SOLD: "sold"

}

Expand Down Expand Up @@ -117,6 +115,7 @@ var StatusEnum = function StatusEnum() {
}



/**
* @return {Integer}
**/
Expand Down Expand Up @@ -203,6 +202,7 @@ var StatusEnum = function StatusEnum() {
this['status'] = status;
}



Pet.prototype.toJson = function() {
return JSON.stringify(this);
Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/javascript-promise/src/model/Tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
}



/**
* @return {Integer}
**/
Expand Down Expand Up @@ -78,6 +79,7 @@
this['name'] = name;
}



Tag.prototype.toJson = function() {
return JSON.stringify(this);
Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/javascript-promise/src/model/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
}



/**
* @return {Integer}
**/
Expand Down Expand Up @@ -219,6 +220,7 @@
this['userStatus'] = userStatus;
}



User.prototype.toJson = function() {
return JSON.stringify(this);
Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/javascript/src/model/Category.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
}



/**
* @return {Integer}
**/
Expand Down Expand Up @@ -78,6 +79,7 @@
this['name'] = name;
}



Category.prototype.toJson = function() {
return JSON.stringify(this);
Expand Down
12 changes: 6 additions & 6 deletions samples/client/petstore/javascript/src/model/Order.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,22 @@ if ( typeof define === "function" && define.amd ) {
});
}

var StatusEnum = function StatusEnum() {
var self = this;

var StatusEnum = {

/**
* @const
*/
self.PLACED = "placed",
PLACED: "placed",

/**
* @const
*/
self.APPROVED = "approved",
APPROVED: "approved",

/**
* @const
*/
self.DELIVERED = "delivered";
DELIVERED: "delivered"

}

Expand Down Expand Up @@ -115,6 +113,7 @@ var StatusEnum = function StatusEnum() {
}



/**
* @return {Integer}
**/
Expand Down Expand Up @@ -201,6 +200,7 @@ var StatusEnum = function StatusEnum() {
this['complete'] = complete;
}



Order.prototype.toJson = function() {
return JSON.stringify(this);
Expand Down
12 changes: 6 additions & 6 deletions samples/client/petstore/javascript/src/model/Pet.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,22 @@ if ( typeof define === "function" && define.amd ) {
});
}

var StatusEnum = function StatusEnum() {
var self = this;

var StatusEnum = {

/**
* @const
*/
self.AVAILABLE = "available",
AVAILABLE: "available",

/**
* @const
*/
self.PENDING = "pending",
PENDING: "pending",

/**
* @const
*/
self.SOLD = "sold";
SOLD: "sold"

}

Expand Down Expand Up @@ -117,6 +115,7 @@ var StatusEnum = function StatusEnum() {
}



/**
* @return {Integer}
**/
Expand Down Expand Up @@ -203,6 +202,7 @@ var StatusEnum = function StatusEnum() {
this['status'] = status;
}



Pet.prototype.toJson = function() {
return JSON.stringify(this);
Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/javascript/src/model/Tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
}



/**
* @return {Integer}
**/
Expand Down Expand Up @@ -78,6 +79,7 @@
this['name'] = name;
}



Tag.prototype.toJson = function() {
return JSON.stringify(this);
Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/javascript/src/model/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
}



/**
* @return {Integer}
**/
Expand Down Expand Up @@ -219,6 +220,7 @@
this['userStatus'] = userStatus;
}



User.prototype.toJson = function() {
return JSON.stringify(this);
Expand Down