diff --git a/connexion/operations/swagger2.py b/connexion/operations/swagger2.py index ea0fab068..6764cc174 100644 --- a/connexion/operations/swagger2.py +++ b/connexion/operations/swagger2.py @@ -160,10 +160,7 @@ def example_response(self, code=None, *args, **kwargs): Returns example response from spec """ # simply use the first/lowest status code, this is probably 200 or 201 - try: - code = code or sorted(self._responses.keys())[0] - except IndexError: - code = 200 + code = code or sorted(self._responses.keys())[0] examples_path = [str(code), 'examples'] schema_example_path = [str(code), 'schema', 'example'] try: