Skip to content

feat(core): annotate domain validation errors with property identifier - #1291

Open
AlessandroPomponio wants to merge 1 commit into
mainfrom
ap_1272_include_property_identifier_in_domain_errors
Open

feat(core): annotate domain validation errors with property identifier#1291
AlessandroPomponio wants to merge 1 commit into
mainfrom
ap_1272_include_property_identifier_in_domain_errors

Conversation

@AlessandroPomponio

@AlessandroPomponio AlessandroPomponio commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

When a Property has a malformed propertyDomain, Pydantic's validation error previously gave no indication of which property was the source of the problem. This change intercepts those errors and prepends the property's identifier to the message, making it immediately clear to users which property is misconfigured.

High-level Changes

  • ado/schema/property.py: Added a model_validator on the Property model that catches ValidationErrors raised during domain validation and re-raises them as a ValueError that includes the property's identifier in the message.
  • tests/schema/test_property.py: Added a test verifying that a malformed propertyDomain on a ConstitutiveProperty produces an error message containing the property's identifier.

Impact

Users configuring properties with invalid domains (e.g. missing required domain fields) will now see a clear error message that names the offending property. No existing behaviour is changed for valid configurations; this is a purely additive improvement to error diagnostics.


AI Disclosure: The code and this PR description were generated using IBM Bob and reviewed manually.

Signed-off-by: Alessandro Pomponio <alessandro.pomponio1@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Enables CI integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(core): error for invalid PropertyDomain of DISCRETE_VARIABLE_TYPE is missing the property identifier

1 participant