         howManyMoreItemsLeft = howManyMoreItems - o.length
         if howManyMoreItemsLeft
           for i in [1..howManyMoreItemsLeft]
-            o.push @generate schema.additionalItems, method, depth + 1
+            o.push @generate schema.additionalItems, depth + 1
           o = _.deepUnique o  if schema.uniqueItems
         howManyMoreItemsLeft = howManyMoreItems - o.length
         break  unless howManyMoreItemsLeft

        # minimum set to 1, not 0, on purpose
      howManyMoreProperties = random 'integer', randomOptions
      for i in [0..howManyMoreProperties]
        o[random 'string', {minimum: 0, maximum: 10}] = @generate schema.additionalProperties, method, depth+1

    else if schema.additionalProperties isnt false
      o[random 'string', {minimum: 0, maximum: 10}] = @generate {type: 'any'}, method, depth+1

    return o


  # type = any
  any: (schema, method = 'all', depth = 0) ->
    types = ['string', 'number', 'integer', 'boolean', 'object', 'null']
    randomOptions =
      minimum: 0
      maximum: types.length-1
    typeIndex = random 'integer', randomOptions
    @generate {type: types[typeIndex]}, method, depth + 1


  # type = []
  oneOf: (schema, method = 'all', depth = 0) ->
    return 0  unless schema.type.length # treat as 'any'
    randomOptions =
      minimum: 0
      maximum: schema.type.length-1
    typeIndex = random 'integer', randomOptions
    @generate schema.type[typeIndex], method, depth + 1



  # type = array
  array: (schema, depth = 0) ->
    o = []
    if type(schema.items) is 'array' and schema.items.length
      for itemSchema in schema.items
        o.push @generate itemSchema, depth + 1

    if schema.additionalItems
      if type(schema.minItems) isnt 'undefined'
