OpenAssetIO / OpenAssetIO-TraitGen

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

C++/Python getTraitProperty consistency. #63

Closed elliotcmorris closed 10 months ago

elliotcmorris commented 10 months ago

Closes #57

C++ getTraitProperty method now returns std::optional<T> rather than throwing when invoked without a default parameter. This mirrors the python behaviour of returning None in this case.

Also adds pair of tests to python test suite to add missing checks about traitViews constructed around empty traitsdatas.

elliotcmorris commented 10 months ago

Following on from our discussion, didn't spot anything on a squiz through of C_API, CODING_STYLE and CODING_STANDARDS about not using standard library types in an interface because of the c-api.

feltech commented 10 months ago

The first commit [Core] Copy python error mode in getTraitProperty could do with updating with the issue number and getTraitProperty -> getSomeProperty or similar.

elliotcmorris commented 10 months ago

@feltech Changed the first commit in a rebase as suggested.