mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
Deferred schema renderer creation to avoid requiring pyyaml. (#6416)
Closes #6366.
This commit is contained in:
parent
f539c0dbd1
commit
8d20e10218
|
@ -32,8 +32,10 @@ class Command(BaseCommand):
|
||||||
self.stdout.write(output.decode('utf-8'))
|
self.stdout.write(output.decode('utf-8'))
|
||||||
|
|
||||||
def get_renderer(self, format):
|
def get_renderer(self, format):
|
||||||
return {
|
renderer_cls = {
|
||||||
'corejson': CoreJSONRenderer(),
|
'corejson': CoreJSONRenderer,
|
||||||
'openapi': OpenAPIRenderer(),
|
'openapi': OpenAPIRenderer,
|
||||||
'openapi-json': JSONOpenAPIRenderer()
|
'openapi-json': JSONOpenAPIRenderer,
|
||||||
}[format]
|
}[format]
|
||||||
|
|
||||||
|
return renderer_cls()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user