Summary
The deserialised metadata classes in Semantics.SourceGenerators/Models/ (e.g. DimensionsMetadata) accept any JSON shape. There is no post-deserialisation validation for required fields (Name, Symbol, base unit, supported forms), unit-string non-emptiness, or referential integrity across dotProducts / crossProducts / integrals / derivatives.
A malformed entry does not surface until the generator either crashes mid-emit or (more commonly, see #56) silently drops the operator.
Suggested next step
- Add a
Validate() method on DimensionsMetadata that runs after JSON deserialisation and throws (or reports diagnostics) for: missing Name/Symbol, empty availableUnits, undeclared form references, unknown referenced dimensions.
- Run it once at the top of each generator pass and bail out with a clear diagnostic when validation fails.
Goes hand in hand with #56 (diagnostics for unresolved references).
Area / Severity
SourceGenerators / Metadata · cleanup
Summary
The deserialised metadata classes in
Semantics.SourceGenerators/Models/(e.g.DimensionsMetadata) accept any JSON shape. There is no post-deserialisation validation for required fields (Name,Symbol, base unit, supported forms), unit-string non-emptiness, or referential integrity acrossdotProducts/crossProducts/integrals/derivatives.A malformed entry does not surface until the generator either crashes mid-emit or (more commonly, see #56) silently drops the operator.
Suggested next step
Validate()method onDimensionsMetadatathat runs after JSON deserialisation and throws (or reports diagnostics) for: missingName/Symbol, emptyavailableUnits, undeclared form references, unknown referenced dimensions.Goes hand in hand with #56 (diagnostics for unresolved references).
Area / Severity
SourceGenerators / Metadata · cleanup