Skip to main content

lyd_value_validate

Function lyd_value_validate 

Source
pub unsafe extern "C" fn lyd_value_validate(
    schema: *const lysc_node,
    value: *const c_char,
    value_len: u32,
    ctx_node: *const lyd_node,
    realtype: *mut *const lysc_type,
    canonical: *mut *const c_char,
) -> Type
Expand description

@brief Check type restrictions applicable to the particular leaf/leaf-list with the given string @p value.

The given node is not modified in any way - it is just checked if the @p value can be set to the node.

@param[in] schema Schema node of the @p value. @param[in] value String value to be checked, it is expected to be in JSON format. @param[in] value_len Length of the given @p value (mandatory). @param[in] ctx_node Optional data tree context node for the value (leafref target, instance-identifier). If not set and is required for the validation to complete, ::LY_EINCOMPLETE is be returned. @param[out] realtype Optional real type of @p value. @param[out] canonical Optional canonical value of @p value in the dictionary, needs to be freed using ::lydict_remove(). @return LY_SUCCESS on success @return LY_EINCOMPLETE in case the @p ctx_node is not provided and it was needed to finish the validation (e.g. due to require-instance). @return LY_ERR value if an error occurred.