Skip to content

Commit 8692d7c

Browse files
committed
Resolved bug with required
Fixes #80
1 parent 9101a20 commit 8692d7c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/services/schema-form.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ angular.module('schemaForm').provider('schemaForm',
286286
options = options || {};
287287

288288
var stdForm = service.defaults(schema, ignore, options);
289-
290289
//simple case, we have a "*", just put the stdForm there
291290
var idx = form.indexOf('*');
292291
if (idx !== -1) {
@@ -371,7 +370,7 @@ angular.module('schemaForm').provider('schemaForm',
371370
if (schema.type === 'object') {
372371
angular.forEach(schema.properties, function(v, k) {
373372
if (ignore[k] !== true) {
374-
var required = schema.required && schema.required.indexOf(k[k.length - 1]) !== -1;
373+
var required = schema.required && schema.required.indexOf(k) !== -1;
375374
var def = defaultFormDefinition(k, v, {
376375
path: [k], // Path to this property in bracket notation.
377376
lookup: lookup, // Extra map to register with. Optimization for merger.

0 commit comments

Comments
 (0)