data type CHANGE remove canonical representation from identityref values
identityref does not have canonical representation, to avoid confusion,
the canonized member of the lyd_value structure is set to NULL in case
of identityref (as it is in case of instance-identifier) and a lexical
representation can be obtained via the type's printer callback.
diff --git a/src/tree_data.h b/src/tree_data.h
index 96e0e81..2b639f5 100644
--- a/src/tree_data.h
+++ b/src/tree_data.h
@@ -167,8 +167,11 @@
* @brief YANG data representation
*/
struct lyd_value {
- const char *canonized; /**< string representation of value (for comparison, printing,...), canonized according to the
- rules implemented in the type's canonization callback (if any). */
+ const char *canonized; /**< Canonical string representation of value (for comparison, printing,...), canonized according to the
+ rules implemented in the type's canonization callback (if any). Note that not all the types
+ have a canonical representation, so this value can be even NULL (identityref or instance-identifiers
+ are built-in examples of such a case). The lyd_value::realtype's print callback provides possibility
+ to get correct string representation of the value for the specific data format. */
union {
const char *string; /**< original, non-canonized string value. Useful for example for unions where the type (and therefore
the cannonization rules) can change by changing value (e.g. leafref target) somewhere else. */