diff --git a/docs/changelog.rst b/docs/changelog.rst index 1c7f22e..0776988 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -3,6 +3,14 @@ Changelog ######### +********* +**1.7.4** +********* + +*Release date: May 14, 2018* + +- **FIXED:** ignore ``None`` return from ``get_operation`` to avoid empty ``Path`` objects in output + ********* **1.7.3** ********* @@ -11,7 +19,6 @@ Changelog - **FIXED:** views whose ``__init__`` methods throw exceptions will now be ignored during endpoint enumeration - ********* **1.7.2** ********* @@ -21,7 +28,6 @@ Changelog - **FIXED:** fixed generation of default ``SECURITY_REQUIREMENTS`` to match documented behaviour - **FIXED:** ordering of ``SECURITY_REQUIREMENTS`` and ``SECURITY_DEFINITIONS`` is now stable - ********* **1.7.1** ********* diff --git a/src/drf_yasg/generators.py b/src/drf_yasg/generators.py index 1a929f2..4e2d556 100644 --- a/src/drf_yasg/generators.py +++ b/src/drf_yasg/generators.py @@ -324,7 +324,9 @@ class OpenAPISchemaGenerator(object): if not public and not self._gen.has_view_permissions(path, method, view): continue - operations[method.lower()] = self.get_operation(view, path, prefix, method, components, request) + operation = self.get_operation(view, path, prefix, method, components, request) + if operation is not None: + operations[method.lower()] = operation if operations: # since the common prefix is used as the API basePath, it must be stripped