I think that we should make create_schema_for_required_keys a public function in the schema module if we're going to call it from here. It doesn't actually seem to be used anywhere else so it shouldn't be a problem.