api_docs: Migrate POST /rest-error-handling.

This commit migrates payload of errors which are common to many endpoints
to /rest-error-handling:post in OpenAPI.
This commit is contained in:
shubhamgupta2956
2020-04-02 05:45:28 +05:30
committed by Tim Abbott
parent a9a16932ec
commit 6ebf408fc4
5 changed files with 62 additions and 24 deletions

View File

@@ -422,8 +422,7 @@ def test_user_not_authorized_error(nonadmin_client):
# type: (Client) -> None
result = nonadmin_client.get_streams(include_all_active=True)
fixture = FIXTURES['user-not-authorized-error']
test_against_fixture(result, fixture)
validate_against_openapi_schema(result, '/rest-error-handling', 'post', '400_user_not_authorized_error')
def get_subscribers(client):
# type: (Client) -> None
@@ -1108,15 +1107,14 @@ def update_user_group_members(client, group_id):
def test_invalid_api_key(client_with_invalid_key):
# type: (Client) -> None
result = client_with_invalid_key.list_subscriptions()
fixture = FIXTURES['invalid-api-key']
test_against_fixture(result, fixture)
validate_against_openapi_schema(result, '/rest-error-handling', 'post', '400_invalid_api_key')
def test_missing_request_argument(client):
# type: (Client) -> None
result = client.render_message({})
fixture = FIXTURES['missing-request-argument-error']
test_against_fixture(result, fixture)
validate_against_openapi_schema(result, '/rest-error-handling', 'post', '400_missing_request_argument_error')
def test_invalid_stream_error(client):
# type: (Client) -> None