code: function(main_schema) {
        main_schema = _.cloneDeep(main_schema);
        if (!main_schema.properties) {
          throw new NoPropertiesFound('propertiesToPropertySchema called for id ' + main_schema.id + ', but it has no properties');
        }
        // Not supporting patternProperties for now because I don't see where I would ever
        // need that.
        main_schema.propertySchema = _M.enumSchema(_.keys(main_schema.properties));
        return main_schema;
      }
docs: propertiesToPropertySchema is a convenience function that fills in the propertySchema for you if you defined all the properties. Doesn't work if you have a complex schema that contains allOf, anyOf, oneOf. NOTE: this DOES NOT mutate the schema passed, it returns a new schema.