scale icon indicating copy to clipboard operation
scale copied to clipboard

Deprecated API Endpoints Should Return Error Message

Open emimaesmith opened this issue 7 years ago • 1 comments

There are some v5 API endpoints that do not have a corresponding v6 implementation (marked for deprecation, etc) that should return an error message indicating it was not ported to v6 instead of simply throwing a 404.

This is more of a nice-to-have rather than a hard requirement as all deprecated API endpoints should be documented in the Scale docs.

emimaesmith avatar Dec 20 '18 17:12 emimaesmith

Here is an example snippet I use:

if self.request.version == 'v6':
    content = 'This endpoint is only supported with REST API v5'
    return Response(status=status.HTTP_400_BAD_REQUEST, data=content)

mikenholt avatar Dec 20 '18 18:12 mikenholt