       reqSchema: (next) -> buildSchemaForRequired resolvedProps, next
     , (err, {propsSchema, reqSchema}) ->
       schema.properties = propsSchema
-      schema.required = reqSchema if reqSchema.length
+      schema.required = reqSchema if reqSchema?.length
       cb null, schema
   else
     cb null, schema

    (next) -> resolveMembers items, resolveItem, heritage, options, next
    (resolvedItems, next) ->
      buildArraySchema {

        arrayNode
        resolvedType
        fixed
        items
        resolvedItems
        options

      }, next
  ], cb


    (next) -> resolveMembers props, resolveProperty, {fixed}, options, next
    (resolvedProps, next) ->
      buildObjectSchema {
        objectNode
        resolvedType
        fixed
        props
        resolvedProps
        options
      }, next
  ], cb

