function convertPluginSchema(schema) {
      var result = {properties: {}, type: 'object'};
      Object.keys(schema.fields).forEach(function (fieldIndexName) {
        var field = schema.fields[fieldIndexName];
        var fieldName = Object.keys(field)[0];
        var fieldData = field[fieldName];
        
        result.properties[fieldName] = {
          type: fieldData.type
        };

        if (fieldData.enum) {
          result.properties[fieldName].enum = fieldData.enum;
        }
        if (fieldData.hasOwnProperty('default')) {
          result.properties[fieldName].default =fieldData.default;
        }
        if (fieldData.hasOwnProperty('required')) {
          result.properties[fieldName].required = fieldData.required;
        }
        if (result.properties[fieldName].type === 'table') {
          result.properties[fieldName].type = 'object';
          if (fieldData.schema.flexible) {
            result.properties[fieldName].additionalProperties = convertPluginSchema(fieldData.schema);
          } else {
            result.properties[fieldName].properties = convertPluginSchema(fieldData.schema).properties;
          }
        }

        if (result.properties[fieldName].type === 'array') {
          // by default, assuming the elements of a property of type array is a string, since it's
          // the case most of the time, and Kong doesn't provide the types of the elements of array properties :(
          result.properties[fieldName].items = {type: 'string'}
        }

      });
      return result;
    }
Convert a "kong" schema to a schema compatible with http://json-schema.org
@param schema