From a4781be1d0a3e4e24d4abaf4c44f0ce8ba191052 Mon Sep 17 00:00:00 2001 From: mruff-aeq Date: Thu, 20 Aug 2026 16:10:48 -0400 Subject: [PATCH 1/3] 34651-legal-api-lock-refresh --- legal-api/poetry.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/legal-api/poetry.lock b/legal-api/poetry.lock index 2dc6ec6e41..eac1b17e13 100644 --- a/legal-api/poetry.lock +++ b/legal-api/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.3.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. [[package]] name = "aiofiles" @@ -316,7 +316,7 @@ files = [ [[package]] name = "business-model" -version = "3.4.8" +version = "3.4.10" description = "" optional = false python-versions = ">=3.13,<3.14" @@ -336,14 +336,14 @@ pg8000 = ">=1.31.2,<2.0.0" pycountry = ">=24.6.1,<25.0.0" pydantic = ">=2.10.6,<3.0.0" pytz = ">=2025.1,<2026.0" -registry-schemas = {git = "https://github.com/bcgov/business-schemas.git", rev = "2.18.79"} +registry-schemas = {git = "https://github.com/bcgov/business-schemas.git", rev = "2.18.81"} sql-versioning = {git = "https://github.com/bcgov/lear.git", rev = "main", subdirectory = "python/common/sql-versioning-alt"} [package.source] type = "git" url = "https://github.com/bcgov/lear.git" reference = "main" -resolved_reference = "5071d8846d154d403527f6d4daf563ee88b1cb85" +resolved_reference = "9ebbf2f737afc6190070c7a70019d3c049d5146a" subdirectory = "python/common/business-registry-model" [[package]] @@ -1462,11 +1462,11 @@ files = [ ] [package.dependencies] -google-api-core = ">=1.31.6,<2.0.dev0 || >2.3.0,<3.0.0.dev0" -google-auth = ">=1.25.0,<3.0.dev0" +google-api-core = ">=1.31.6,<2.0.dev0 || >2.3.0,<3.0.0dev" +google-auth = ">=1.25.0,<3.0dev" [package.extras] -grpc = ["grpcio (>=1.38.0,<2.0.dev0)", "grpcio-status (>=1.38.0,<2.0.dev0)"] +grpc = ["grpcio (>=1.38.0,<2.0dev)", "grpcio-status (>=1.38.0,<2.0.dev0)"] [[package]] name = "google-cloud-datastore" @@ -1913,7 +1913,7 @@ fqdn = {version = "*", optional = true, markers = "extra == \"format\""} idna = {version = "*", optional = true, markers = "extra == \"format\""} isoduration = {version = "*", optional = true, markers = "extra == \"format\""} jsonpointer = {version = ">1.13", optional = true, markers = "extra == \"format\""} -jsonschema-specifications = ">=2023.3.6" +jsonschema-specifications = ">=2023.03.6" referencing = ">=0.28.4" rfc3339-validator = {version = "*", optional = true, markers = "extra == \"format\""} rfc3987 = {version = "*", optional = true, markers = "extra == \"format\""} @@ -3336,7 +3336,7 @@ rpds-py = ">=0.7.0" [[package]] name = "registry_schemas" -version = "2.18.78" +version = "2.18.81" description = "A short description of the project" optional = false python-versions = ">=3.6" @@ -3354,8 +3354,8 @@ strict-rfc3339 = "*" [package.source] type = "git" url = "https://github.com/bcgov/business-schemas.git" -reference = "2.18.79" -resolved_reference = "40080a9b693e0090fae08db377baf94e34cb7588" +reference = "2.18.81" +resolved_reference = "d30c9eb9333f875eb916c5b4c1f083d13998d931" [[package]] name = "reportlab" From b0c865381a86fe2af9346cb5dd39ccf37b0f7820 Mon Sep 17 00:00:00 2001 From: mruff-aeq Date: Thu, 20 Aug 2026 17:04:08 -0400 Subject: [PATCH 2/3] 34651-legal-api-lock-refresh --- legal-api/src/legal_api/utils/util.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/legal-api/src/legal_api/utils/util.py b/legal-api/src/legal_api/utils/util.py index 3fc946899c..160250772e 100644 --- a/legal-api/src/legal_api/utils/util.py +++ b/legal-api/src/legal_api/utils/util.py @@ -37,14 +37,18 @@ def build_schema_error_response(errors): formatted_errors = [] for error in errors: validation_errors = [] - for context in error.context: + for context in error.context or []: validation_errors.append({ "message": context.message, "jsonPath": context.json_path, "validator": context.validator, "validatorValue": context.validator_value }) - formatted_errors.append({"path": "/".join(error.path), "error": error.message, "context": validation_errors}) + formatted_errors.append({ + "path": "/".join(str(part) for part in error.path), + "error": error.message, + "context": validation_errors + }) return formatted_errors From e5dcee13a883167c8b1e8beada852580d04c8928 Mon Sep 17 00:00:00 2001 From: mruff-aeq Date: Thu, 20 Aug 2026 17:22:08 -0400 Subject: [PATCH 3/3] 34651-legal-api-lock-refresh --- legal-api/tests/unit/services/filings/test_schemas.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/legal-api/tests/unit/services/filings/test_schemas.py b/legal-api/tests/unit/services/filings/test_schemas.py index c45a50ae17..2ec11e1996 100644 --- a/legal-api/tests/unit/services/filings/test_schemas.py +++ b/legal-api/tests/unit/services/filings/test_schemas.py @@ -55,15 +55,13 @@ def test_validate_schema_bad_cr(app): """Assert that an invalid AR returns an error.""" # validate_schema(json_data: Dict = None) -> Tuple(int, str): cr = copy.deepcopy(CORRECTION_REGISTRATION) - cr['filing']['correction']['parties'][0]['officer']['firstName'] = \ - 'this_first_name_maximum_length_is_over' - cr['filing']['correction']['parties'][0]['officer']['middleName'] = \ - 'this_first_name_maximum_length_is_over' + cr['filing']['correction']['parties'][0]['officer']['firstName'] = 'a' * 61 with app.app_context(): err = schemas.validate_against_schema(cr) assert {'error': "", 'path': 'filing', 'context': []}.keys() == err.msg[0].keys() - assert "is not valid under any of the given schemas" in err.msg[0]['error'] - + assert "is too long" in err.msg[0]['error'] + assert err.msg[0]['path'] == 'correction/parties/0/officer/firstName' + assert err.code == HTTPStatus.UNPROCESSABLE_ENTITY