      def add_arguments(self, parser):
          parser.add_argument('--title', dest="title", default=None, type=str)
          parser.add_argument('--url', dest="url", default=None, type=str)
          parser.add_argument('--description', dest="description", default=None, type=str)
          parser.add_argument('--format', dest="format", choices=['openapi', 'openapi-json', 'corejson'], default='openapi', type=str)
  
      def handle(self, *args, **options):
          assert coreapi is not None, 'coreapi must be installed.'
  
          generator = SchemaGenerator(
 
</s> remove         parser.add_argument('--title', dest="title", default=None, type=str)
 </s> add         parser.add_argument('--title', dest="title", default='', type=str) </s> remove         assert coreapi is not None, 'coreapi must be installed.'

        generator = SchemaGenerator(
 </s> add         generator_class = self.get_generator_class()
        generator = generator_class( </s> remove         assert coreapi, 'Using OpenAPIRenderer, but `coreapi` is not installed.'
        assert yaml, 'Using OpenAPIRenderer, but `pyyaml` is not installed.'
 </s> add         assert coreapi, 'Using CoreAPIOpenAPIRenderer, but `coreapi` is not installed.'
        assert yaml, 'Using CoreAPIOpenAPIRenderer, but `pyyaml` is not installed.'
        if self.get_mode() == COREAPI_MODE:
            parser.add_argument('--format', dest="format", choices=['openapi', 'openapi-json', 'corejson'], default='openapi', type=str)
        else:
            parser.add_argument('--format', dest="format", choices=['openapi', 'openapi-json'], default='openapi', type=str)
      def add_arguments(self, parser):
          parser.add_argument('--title', dest="title", default=None, type=str)
          parser.add_argument('--url', dest="url", default=None, type=str)
          parser.add_argument('--description', dest="description", default=None, type=str)
        if self.get_mode() == COREAPI_MODE:
            parser.add_argument('--format', dest="format", choices=['openapi', 'openapi-json', 'corejson'], default='openapi', type=str)
        else:
            parser.add_argument('--format', dest="format", choices=['openapi', 'openapi-json'], default='openapi', type=str)
  
      def handle(self, *args, **options):
          assert coreapi is not None, 'coreapi must be installed.'
  
          generator = SchemaGenerator(
keep keep keep keep replace keep keep keep keep keep
 Added OpenAPI Schema Generation. (#6532)

Co-authored-by: Lucidiot <lucidiot@protonmail.com>
Co-authored-by: dongfangtianyu <dongfangtianyu@qq.com> 
rest_framework/management/commands/generateschema.py