From 4a1ac909e8953426f2d4011e91e3ea91f5a56c4c Mon Sep 17 00:00:00 2001 From: aMetallurgist Date: Sun, 31 Mar 2024 17:32:01 -0700 Subject: [PATCH] Remove lastName required parameter from the OpenAPI user schema --- api/openapi_server/controllers/auth_controller.py | 2 +- api/openapi_server/openapi/schemas/_index.yaml | 1 - api/tests/test_authentication.py | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/api/openapi_server/controllers/auth_controller.py b/api/openapi_server/controllers/auth_controller.py index 95ce645c..466b013d 100644 --- a/api/openapi_server/controllers/auth_controller.py +++ b/api/openapi_server/controllers/auth_controller.py @@ -72,7 +72,7 @@ def sign_up(body: dict, role: UserRole): role=role, firstName=body['firstName'], middleName=body.get('middleName', ''), - lastName=body['lastName'] + lastName=body.get('lastName', '') ) except Exception as error: raise AuthError({"message": str(error)}, 400) diff --git a/api/openapi_server/openapi/schemas/_index.yaml b/api/openapi_server/openapi/schemas/_index.yaml index 4674c016..84a6c2bc 100644 --- a/api/openapi_server/openapi/schemas/_index.yaml +++ b/api/openapi_server/openapi/schemas/_index.yaml @@ -73,7 +73,6 @@ UserSchema: required: - email - firstName - - lastName UserSignupSchema: type: object allOf: diff --git a/api/tests/test_authentication.py b/api/tests/test_authentication.py index 889cc039..75a35a59 100644 --- a/api/tests/test_authentication.py +++ b/api/tests/test_authentication.py @@ -47,11 +47,6 @@ def test_signup_with_missing_fields(client, endpoint): 'email': 'inbox928@placeholder.org', 'password': 'Fakepass%^&7!asdf' }, - { - 'email': 'inbox928@placeholder.org', - 'password': 'Fakepass%^&7!asdf', - 'firstName': 'Josh' - }, { 'email': 'inbox928@placeholder.org', 'password': 'Fakepass%^&7!asdf',