OpenAssetIO / OpenAssetIO-TraitGen

A code generation tool that produces OpenAssetIO Traits and Specifications from a simple YAML description.
Apache License 2.0
5 stars 3 forks source link

Validate required property #79

Closed elliotcmorris closed 4 days ago

elliotcmorris commented 2 months ago

If we add a tag to the yaml schema required to each property, there is some validation we can do to be friendlier. Most directly, we can emit a better error message when the property is not set, so the recipient knows the error is not their fault, and knows who to go to to address it.

feltech commented 1 month ago

The example potential solution given is not possible since we switched to std::optional rather than exceptions.

A more breaking change would be to remove the std::optionalness of required properties, and throw an exception saying the value should have been set.

feltech commented 4 days ago

Carefully consider this in the context of established rules in our GUIDELINES

feltech commented 4 days ago

I'm going to close this, since it reverses current guidelines, and the proposed solution wouldn't work anyway.