mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +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'))
|
||||
|
||||
def get_renderer(self, format):
|
||||
return {
|
||||
'corejson': CoreJSONRenderer(),
|
||||
'openapi': OpenAPIRenderer(),
|
||||
'openapi-json': JSONOpenAPIRenderer()
|
||||
renderer_cls = {
|
||||
'corejson': CoreJSONRenderer,
|
||||
'openapi': OpenAPIRenderer,
|
||||
'openapi-json': JSONOpenAPIRenderer,
|
||||
}[format]
|
||||
|
||||
return renderer_cls()
|
||||
|
|
Loading…
Reference in New Issue
Block a user