Skip to content

Commit 54b89ad

Browse files
committed
✨ Improves missing value validation message, as error type is now model_field_validation.missing.
1 parent c79c958 commit 54b89ad

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

HISTORY.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ History
55
0.1.3 (unreleased)
66
------------------
77

8-
- Nothing changed yet.
8+
- Improves missing value validation message, as error type is now ``model_field_validation.missing``.
99

1010

1111
0.1.2 (2024-10-09)

fhir_core/fhirabstractmodel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
FHIRErrorCodes = Literal[
4242
"fhir-validation-missing-resource-type",
4343
"fhir-validation-wrong-resource-type",
44+
"model_field_validation.missing",
4445
]
4546

4647

@@ -559,7 +560,7 @@ def _validate_required_primitive_elements(self):
559560
if value in (_missing, None):
560561
# 'field required'
561562
error_type = PydanticCustomError(
562-
"model_field_validation_format",
563+
"model_field_validation.missing",
563564
"Value for the field '{field_name}' is required.",
564565
{"field_name": field_info.alias},
565566
)

0 commit comments

Comments
 (0)