   random 'number', randomOptions
 
 
-generate.boolean = (schema, method = 'all', depth = 0) ->
-  random 'boolean'
+# type = string
+generate.string = (schema, method = 'all', depth = 0) ->
+  return randexp schema.pattern  if schema.pattern
+  # FIXME format should not be ignored
+  randomOptions =
+    minLength: schema.minLength
+    maxLength: schema.maxLength
+  random 'string', randomOptions
 
 
+# type = array
 generate.array = (schema, method = 'all', depth = 0) ->
   o = []
   if type(schema.items) is 'array' and schema.items.length
     for itemSchema in schema.items
       o.push generate itemSchema, method, depth + 1
-  else if type(schema.items) is 'object'
-    # FIXME items should not be a schema, really
-    console.log schema.items
-    throw "items should not be a schema, really"
 
   if schema.additionalItems
-    # break  if schema.additionalItems.$ref?[0] is '#'
     if type(schema.minItems) isnt 'undefined'
       minimum = schema.minItems - o.length
     else

  o


generate.object = (schema, method = 'all', depth = 0) ->
  o = {}
  for key, prop of schema.properties

  generate enumValue, method, depth + 1


# type = null
generate.null = () ->
  null


# type = boolean
generate.boolean = (schema, method = 'all', depth = 0) ->
  random 'boolean'


# type = number / integer
generate.number = generate.integer = (schema, method = 'all', depth = 0) ->
  minimum = schema.exclusiveMinimum + 1  if schema.exclusiveMinimum
  minimum ?= schema.minimum
