This commit is contained in:
Tony Tam
2014-10-18 17:38:25 -07:00
parent de0f9d58ee
commit 9ba4c38783
3 changed files with 1584 additions and 1505 deletions

View File

@@ -1104,6 +1104,7 @@ var Property = function(name, obj, required) {
this.description = obj.description;
this.obj = obj;
this.optional = true;
this.default = obj.default || null;
this.example = obj.example || null;
}
@@ -1136,6 +1137,8 @@ Property.prototype.sampleValue = function(isArray, ignoredModels) {
}
else if(this.example)
output = this.example;
else if(this.default)
output = this.default;
else if(type === 'date-time')
output = new Date().toISOString();
else if(type === 'string')

3055
dist/lib/swagger.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1104,6 +1104,7 @@ var Property = function(name, obj, required) {
this.description = obj.description;
this.obj = obj;
this.optional = true;
this.default = obj.default || null;
this.example = obj.example || null;
}
@@ -1136,6 +1137,8 @@ Property.prototype.sampleValue = function(isArray, ignoredModels) {
}
else if(this.example)
output = this.example;
else if(this.default)
output = this.default;
else if(type === 'date-time')
output = new Date().toISOString();
else if(type === 'string')