diff --git a/rest_framework_swagger/renderers.py b/rest_framework_swagger/renderers.py
index <HASH>..<HASH> 100644
--- a/rest_framework_swagger/renderers.py
+++ b/rest_framework_swagger/renderers.py
@@ -2,6 +2,7 @@ from coreapi.compat import force_bytes
 from django.shortcuts import render, resolve_url
 from openapi_codec import OpenAPICodec
 from rest_framework.renderers import BaseRenderer
+from rest_framework import status
 import simplejson as json
 
 from .settings import swagger_settings
@@ -13,9 +14,10 @@ class OpenAPIRenderer(BaseRenderer):
     format = 'openapi'
 
     def render(self, data, accepted_media_type=None, renderer_context=None):
+        if renderer_context['response'].status_code != status.HTTP_200_OK:
+            return {}
         data = self.get_openapi_specification(data)
         self.add_customizations(data, renderer_context)
-
         return self.dump(data)
 
     def dump(self, data):
Do not try to render failed responses

There might be a <I> response because of a missing version header.

Not sure if this is the right approach here, but this resulted in a "<I>
…" message in SwaggerUI instead of a error-<I> html dump.

Related: <URL>