Fix formatting in endpoints/api/error.py

This commit is contained in:
Evan Cordell 2016-04-12 16:53:50 -04:00
parent 1cdbd89120
commit d67c4ba46c

View file

@ -1,6 +1,5 @@
""" Error details API """ """ Error details API """
from flask import url_for from flask import url_for
from enum import Enum
from endpoints.api import (resource, nickname, ApiResource, path_param, from endpoints.api import (resource, nickname, ApiResource, path_param,
define_json_response) define_json_response)
@ -33,13 +32,19 @@ class Error(ApiResource):
'description': 'A reference to the error type resource' 'description': 'A reference to the error type resource'
}, },
'title': { 'title': {
'type': 'string', 'type': 'string',
'description': 'The title of the error. Can be used to uniquely identify the kind of error.', 'description': (
'enum': list(ApiErrorType.__members__) 'The title of the error. Can be used to uniquely identify the kind'
' of error.'
),
'enum': list(ApiErrorType.__members__)
}, },
'description': { 'description': {
'type': 'string', 'type': 'string',
'description': 'A more detailed description of the error that may include help for fixing the issue.' 'description': (
'A more detailed description of the error that may include help for'
' fixing the issue.'
)
} }
}, },
}, },
@ -50,6 +55,7 @@ class Error(ApiResource):
def get(self, error_type): def get(self, error_type):
""" Get a detailed description of the error """ """ Get a detailed description of the error """
if error_type in ERROR_DESCRIPTION.keys(): if error_type in ERROR_DESCRIPTION.keys():
return error_view(error_type) return error_view(error_type)
raise NotFound() raise NotFound()