@@ -119,7 +119,7 @@ define([
119119
120120 for ( var i in objectSchema ) {
121121 if ( ! objectSchema . hasOwnProperty ( i ) ) continue ;
122-
122+
123123 var objectField = objectSchema [ i ] ;
124124
125125 setRequiredValidators ( objectField . required , objectField . properties ) ;
@@ -180,7 +180,7 @@ define([
180180
181181 function trimEmptyProperties ( object ) {
182182 for ( var key in object ) {
183- if ( ! object . hasOwnProperty ( key ) || object [ key ] . type !== 'object' ) continue ;
183+ if ( ! object . hasOwnProperty ( key ) || object [ key ] . type !== 'object' || object [ key ] . _backboneForms ) continue ;
184184 if ( _ . isEmpty ( object [ key ] . properties ) ) delete object [ key ] ;
185185 }
186186 }
@@ -229,11 +229,11 @@ define([
229229 }
230230 /*
231231 * Delete any 'empty' fieldsets:
232- * - No fields specified
232+ * - No fields specified
233233 * - Only an empty object with no sub-props exists on the schema, so there's nothing to render
234234 * */
235235 const noFieldsOnSchema = fields . some ( f => {
236- return ! schema [ f ] || ( schema [ f ] . type === 'object' && schema [ f ] . properties === undefined ) ;
236+ return ! schema [ f ] || ( schema [ f ] . type === 'object' && ( schema [ f ] . properties === undefined && ! schema [ f ] . _backboneForms ) ) ;
237237 } ) ;
238238 if ( ! fields . length || noFieldsOnSchema ) delete fieldsets [ k ] ;
239239 } ) ;
@@ -339,4 +339,4 @@ define([
339339 } ) ;
340340
341341 Origin . scaffold = Scaffold ;
342- } ) ;
342+ } ) ;
0 commit comments