Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Commit

Permalink
Fix for required helper when inside an ‘allOf’ composition.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkedy committed Jan 15, 2017
1 parent 5e323a1 commit 60bac80
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/modules/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ module.exports.initialize = function() {
value.required = _.includes(model.required, key);
});
}
if (model.allOf) {
_.each(model.allOf, function(schema) {
_.each(schema.properties, function(value, key) {
value.required = _.includes(schema.required, key);
});
});
}
});

this.onFinalize('Model', function(context) {
Expand Down

0 comments on commit 60bac80

Please sign in to comment.