cli: add more unwanted_locations to handle_validation_error

This commit is contained in:
Sina Atalay 2024-05-17 15:28:08 +03:00
parent 1e2509839a
commit 3679684264
1 changed files with 1 additions and 1 deletions

View File

@ -197,7 +197,7 @@ def handle_validation_error(exception: pydantic.ValidationError):
# some locations are not really the locations in the input file, but some # some locations are not really the locations in the input file, but some
# information about the model coming from Pydantic. We need to remove them. # information about the model coming from Pydantic. We need to remove them.
# (e.g. avoid stuff like .end_date.literal['present']) # (e.g. avoid stuff like .end_date.literal['present'])
unwanted_locations = ["tagged-union", "list", "literal"] unwanted_locations = ["tagged-union", "list", "literal", "int", "constrained-str"]
for error_object in errors: for error_object in errors:
location = error_object["loc"] location = error_object["loc"]
new_location = [str(location_element) for location_element in location] new_location = [str(location_element) for location_element in location]