pub fn add_attribute(
config_json: &str,
params: AddAttributeParams<'_>,
) -> Result<(String, Value)>Expand description
Add a new attribute to the configuration
§Arguments
config_json- JSON configuration stringparams- Attribute parameters (attribute, feature, element, class required; others optional)
§Returns
Tuple of (modified_json, new_attribute_value) - returns both the modified config and the newly created attribute for display purposes
§Errors
AlreadyExistsif attribute code already existsInvalidInputif attribute class is invalidJsonParseif config_json is invalidMissingSectionif required sections don’t exist