Summary
The file src/property_type.rs is currently empty. The property type validation system needs implementation — currently, validate_property_type() in model_manager.rs is a stub that always returns Ok(()), and all PropertyValidator implementations for primitive types (StringProperty, IntegerProperty, DoubleProperty, LongProperty, BooleanProperty, DateTimeProperty) are no-ops via macro.
This means none of the following are being validated:
- String regex validators (is the regex pattern valid?)
- String length validators (is
minLength ≤ maxLength? are both ≥ 0?)
- Integer/Long/Double range validators (is
lower ≤ upper?)
- Default values (is the default within the declared range?)
- Object property type references (does the referenced type exist?)
- Relationship property type references (does the referenced type exist and is it identified?)
Proposal
Implement a PropertyType enum in property_type.rs that:
- Parses the
_class discriminator string on Property to determine the concrete property type (e.g., "concerto.metamodel@1.0.0.StringProperty" → PropertyType::String)
- Validates type-specific constraints (regex compilation, range validity, type reference resolution)
- Integrates with
ModelManager::validate_property_type() to replace the current no-op stub
Context
The metamodel defines 9 property types (Property, StringProperty, IntegerProperty, LongProperty, DoubleProperty, BooleanProperty, DateTimeProperty, ObjectProperty, RelationshipProperty), each with different extra fields (validators, default values, type references). However, concepts currently store properties as Vec<Property> — the generic struct that lacks these type-specific fields.
The _class field on each Property already contains the type discriminator, but no dispatch logic exists to extract or validate type-specific data.
Summary
The file src/property_type.rs is currently empty. The property type validation system needs implementation — currently, validate_property_type() in model_manager.rs is a stub that always returns
Ok(()), and all PropertyValidator implementations for primitive types (StringProperty, IntegerProperty, DoubleProperty, LongProperty, BooleanProperty, DateTimeProperty) are no-ops via macro.This means none of the following are being validated:
minLength ≤ maxLength? are both ≥ 0?)lower ≤ upper?)Proposal
Implement a
PropertyTypeenum in property_type.rs that:_classdiscriminator string on Property to determine the concrete property type (e.g.,"concerto.metamodel@1.0.0.StringProperty"→PropertyType::String)ModelManager::validate_property_type()to replace the current no-op stubContext
The metamodel defines 9 property types (Property, StringProperty, IntegerProperty, LongProperty, DoubleProperty, BooleanProperty, DateTimeProperty, ObjectProperty, RelationshipProperty), each with different extra fields (validators, default values, type references). However, concepts currently store properties as
Vec<Property>— the generic struct that lacks these type-specific fields.The
_classfield on each Property already contains the type discriminator, but no dispatch logic exists to extract or validate type-specific data.