 # @param attributes [Object] Payload attributes object
 # @param contentType [Object] Payload content type
 generateSchema = (payload, attributes, contentType, callback) ->
-  if !GENERATE_SCHEMA or (not attributes? or payload.schema or contentType.indexOf('json') is -1)
-    return callback null, payload, attributes, contentType
+  unless GENERATE_SCHEMA is true
+    return callback null
+
+  if not attributes? or payload.schema or contentType.indexOf('json') is -1
+    return callback null
 
   boutique.represent
     ast: attributes,

    resolvedAttributes ?= attributes
    resolvedAttributes ?= actionAttributes

    async.waterfall [
      (cb) ->
        cb null, payload, resolvedAttributes, contentType
      , generateBody
      , generateSchema
    ], (error) ->
      callback error or null

  # Expand a certain node with the given rules
  #

deepcopy = require 'deepcopy'
deepEqual = require 'deep-equal'

GENERATE_BODY = true
GENERATE_SCHEMA = true
EXPAND_TYPES = true

# Gather all payloads from the given parse result
