scale
scale copied to clipboard
Deprecated API Endpoints Should Return Error Message
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.
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)