float additionalProperties and description to top

This commit is contained in:
Ying Tang 2015-04-07 11:30:54 -07:00
parent a91eb2fb04
commit e93d87375b
1 changed files with 9 additions and 11 deletions

View File

@ -121,15 +121,9 @@ var modelHelper = module.exports = {
});
out[name] = {
id: name,
properties: properties,
required: required
id: name
};
if (def.description){
out[name].description = Array.isArray(def.description) ? def.description.join('') : def.description;
}
if (def.settings){
var strict = def.settings.strict;
var additionalProperties = def.settings.additionalProperties;
@ -139,6 +133,13 @@ var modelHelper = module.exports = {
}
}
if (def.description){
out[name].description = Array.isArray(def.description) ? def.description.join('') : def.description;
}
out[name].properties = properties;
out[name].required = required;
// Generate model definitions for related models
for (var r in modelClass.relations) {
var rel = modelClass.relations[r];
@ -243,7 +244,4 @@ var modelHelper = module.exports = {
}
return out;
}
};
};