diff --git a/openapi_python_client/parser/properties/__init__.py b/openapi_python_client/parser/properties/__init__.py index f85c7b746..eda22c894 100644 --- a/openapi_python_client/parser/properties/__init__.py +++ b/openapi_python_client/parser/properties/__init__.py @@ -38,7 +38,7 @@ class ResponseType(Enum): AUTO = 'auto' # Automatically decide whether a response is a failed or success response - every response within the rance [200, 300) will be considered success, others as failed - FAILED = 'failed' # Explicitly specified failed response + FAILURE = 'failure' # Explicitly specified failed response SUCCESS = 'success' # Explicitly specified success response diff --git a/openapi_python_client/parser/responses.py b/openapi_python_client/parser/responses.py index 05792b0c3..aa81c7ce5 100644 --- a/openapi_python_client/parser/responses.py +++ b/openapi_python_client/parser/responses.py @@ -105,7 +105,7 @@ def response_from_data( if response_type == ResponseType.AUTO: failed_status = status_code < HTTPStatus.OK or status_code >= HTTPStatus.MULTIPLE_CHOICES else: - failed_status = response_type == ResponseType.FAILED + failed_status = response_type == ResponseType.FAILURE prop, schemas = property_from_data( name=response_name,