             # Set Multipart body
             else if headers['Content-Type'] == "multipart/form-data"
               pawRequest.multipartBody = formData
-          
+
         return pawRequest
-    
+
     @has_basic_auth = (swaggerCollection, swaggerRequestValue) ->
-      for security in swaggerRequestValue.security
-        for own key, value of security
-          if swaggerCollection.securityDefinitions[key] and swaggerCollection.securityDefinitions[key].type == 'basic'
-            return true
-          break
+      if swaggerRequestValue.security
+        for security in swaggerRequestValue.security
+          for own key, value of security
+            if swaggerCollection.securityDefinitions[key] and swaggerCollection.securityDefinitions[key].type == 'basic'
+              return true
+            break
       return false
-      
+
     @json_from_definition_schema = (swaggerCollection, property, indent = 0) ->
-      
+
         if property.type == 'string'
             s = "\"string\""
         else if property.type == 'integer'

        else if typeof(property) == 'object'
            indent_str = Array(indent + 1).join('    ')
            indent_str_children = Array(indent + 2).join('    ')
            
            if property.items
              property = property.items
              s = "[\n" +

          swaggerRequestTitle = swaggerRequestValue.summary
        else
          swaggerRequestTitle = swaggerRequestPath

        headers = {}
        queries = {}
        formData = {}
        body

        # Extract contentType from Consumes and add the first one to Headers
        if swaggerRequestValue.consumes
          for contentType in swaggerRequestValue.consumes
            headers["Content-Type"] = contentType
            break

        # Extract Headers and Query params
        for index, swaggerRequestParamValue of swaggerRequestValue.parameters

          # Add Queries
          if swaggerRequestParamValue.in == 'query' and swaggerRequestParamValue.type == 'string'
            queries[swaggerRequestParamValue.name] = swaggerRequestParamValue.name

          # Add Headers
          if swaggerRequestParamValue.in == 'header' and swaggerRequestParamValue.type == 'string'
            headers[swaggerRequestParamValue.name] = swaggerRequestParamValue.name

          # Add Url Encoded
          if swaggerRequestParamValue.in == 'formData' and swaggerRequestParamValue.type == 'string'
            formData[swaggerRequestParamValue.name] = swaggerRequestParamValue.name

          # Add Body
          if swaggerRequestParamValue.in == 'body' #Only string
            body = @json_from_definition_schema swaggerCollection, swaggerRequestParamValue.schema

        swaggerRequestUrl = @createSwaggerRequestUrl swaggerCollection, swaggerRequestPath, queries
        swaggerRequestMethod = swaggerRequestMethod.toUpperCase()

        # Create Paw request
        pawRequest = context.createRequest swaggerRequestTitle, swaggerRequestMethod, swaggerRequestUrl

        # Add Headers
        for key, value of headers
          pawRequest.setHeader key, value

        # Add Basic Auth if required
        pawRequest.setHeader "Authorization", "HTTP Basic Auth (Username/Password)" if @has_basic_auth swaggerCollection, swaggerRequestValue

        # Set raw body
        pawRequest.body = body if body

        # Set Form URL-Encoded body
        if Object.keys(formData).length > 0
            # Set Form URL-Encoded body
