mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 01:26:53 +03:00
Add --api-version CLI option to generateschema (#8663)
* Add --version CLI option to generateschema * fix conflicting argument name
This commit is contained in:
parent
f34f1562ff
commit
eb88dfc4b4
|
@ -26,6 +26,7 @@ class Command(BaseCommand):
|
||||||
parser.add_argument('--urlconf', dest="urlconf", default=None, type=str)
|
parser.add_argument('--urlconf', dest="urlconf", default=None, type=str)
|
||||||
parser.add_argument('--generator_class', dest="generator_class", default=None, type=str)
|
parser.add_argument('--generator_class', dest="generator_class", default=None, type=str)
|
||||||
parser.add_argument('--file', dest="file", default=None, type=str)
|
parser.add_argument('--file', dest="file", default=None, type=str)
|
||||||
|
parser.add_argument('--api_version', dest="api_version", default='', type=str)
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
if options['generator_class']:
|
if options['generator_class']:
|
||||||
|
@ -37,6 +38,7 @@ class Command(BaseCommand):
|
||||||
title=options['title'],
|
title=options['title'],
|
||||||
description=options['description'],
|
description=options['description'],
|
||||||
urlconf=options['urlconf'],
|
urlconf=options['urlconf'],
|
||||||
|
version=options['api_version'],
|
||||||
)
|
)
|
||||||
schema = generator.get_schema(request=None, public=True)
|
schema = generator.get_schema(request=None, public=True)
|
||||||
renderer = self.get_renderer(options['format'])
|
renderer = self.get_renderer(options['format'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user