docs: function convertType(swaggerType, swagger) {
  
      var typespec = { description: swaggerType.description, isEnum: false };
  
      if (swaggerType.hasOwnProperty('schema')) {
          return convertType(swaggerType.schema);
      } else if (_.isString(swaggerType.$ref)) {
          typespec.tsType = 'ref';
          typespec.target = swaggerType.$ref.substring(swaggerType.$ref.lastIndexOf('/') + 1);
      } else if (swaggerType.hasOwnProperty('enum')) {
          typespec.tsType = swaggerType.enum.map(function(str) { return JSON.stringify(str); }).join(' | ');
          typespec.isAtomic = true;
          typespec.isEnum = true;
      } else if (swaggerType.type === 'string') {
          typespec.tsType = 'string';
      } else if (swaggerType.type === 'number' || swaggerType.type === 'integer') {
          typespec.tsType = 'number';
      } else if (swaggerType.type === 'boolean') {
          typespec.tsType = 'boolean';
      } else if (swaggerType.type === 'array') {
          typespec.tsType = 'array';
          typespec.elementType = convertType(swaggerType.items);
      } else /*if (swaggerType.type === 'object')*/ { //remaining types are created as objects
          if (swaggerType.minItems >= 0 && swaggerType.hasOwnProperty('title') && !swaggerType.$ref) {
              typespec.tsType = 'any';
          }
          else {
              typespec.tsType = 'object';
              typespec.properties = [];
              if (swaggerType.allOf) {
                  _.forEach(swaggerType.allOf, function (ref) {
                      if(ref.$ref) {
                          var refSegments = ref.$ref.split('/');
                          var name = refSegments[refSegments.length - 1];
                          _.forEach(swagger.definitions, function (definition, definitionName) {
                              if (definitionName === name) {
                                  var property = convertType(definition, swagger);
                                  Array.prototype.push.apply(typespec.properties, property.properties);
                              }
                          });
                      } else {
                          var property = convertType(ref);
                          Array.prototype.push.apply(typespec.properties, property.properties);
                      }
                  });
              }
  
              _.forEach(swaggerType.properties, function (propertyType, propertyName) {
                  var property = convertType(propertyType);
                  property.name = propertyName;
  
                  property.optional = true;
                  if (swaggerType.required && swaggerType.required.indexOf(propertyName) !== -1) {
                    property.optional = false;
                  }
  
                  typespec.properties.push(property);
              });
          }
      } /*else {
       // type unknown or unsupported... just map to 'any'...
       typespec.tsType = 'any';
       }*/
  
      // Since Mustache does not provide equality checks, we need to do the case distinction via explicit booleans
      typespec.isRef = typespec.tsType === 'ref';
      typespec.isObject = typespec.tsType === 'object';
      typespec.isArray = typespec.tsType === 'array';
      typespec.isAtomic = typespec.isAtomic || _.includes(['string', 'number', 'boolean', 'any'], typespec.tsType);
  
      return typespec;
  }