review comments
This commit is contained in:
parent
c001bd6b01
commit
7af616b21a
|
@ -97,7 +97,7 @@ var modelHelper = module.exports = {
|
|||
delete prop.required;
|
||||
delete prop.id;
|
||||
|
||||
if (prop.description) {
|
||||
if (prop.description){
|
||||
prop.description = Array.isArray(prop.description) ? prop.description.join('') : prop.description;
|
||||
}
|
||||
|
||||
|
@ -120,26 +120,27 @@ var modelHelper = module.exports = {
|
|||
}
|
||||
});
|
||||
|
||||
out[name] = {
|
||||
id: name
|
||||
};
|
||||
|
||||
var additionalProperties = undefined;
|
||||
if (def.settings){
|
||||
var strict = def.settings.strict;
|
||||
var additionalProperties = def.settings.additionalProperties;
|
||||
additionalProperties = def.settings.additionalProperties;
|
||||
var notAllowAdditionalProperties = strict || (additionalProperties !== true);
|
||||
if (notAllowAdditionalProperties){
|
||||
out[name].additionalProperties = !notAllowAdditionalProperties;
|
||||
additionalProperties = false;
|
||||
}
|
||||
}
|
||||
|
||||
out[name] = {
|
||||
id: name,
|
||||
additionalProperties: additionalProperties,
|
||||
properties: properties,
|
||||
required: required
|
||||
};
|
||||
|
||||
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];
|
||||
|
|
Loading…
Reference in New Issue