Skip to main content

parse_metadata_value

Function parse_metadata_value 

Source
pub fn parse_metadata_value(
    key: &str,
    value: &str,
    schema: &TypeDefinition,
) -> Result<MetadataValue, ValidationError>
Expand description

Parse a metadata value string into the appropriate MetadataValue type, consulting the schema for field-type information. Validates enum constraints when the field definition specifies enum_values.

Unknown keys are a hard error — engine code that builds metadata only emits schema-declared fields, so a lenient insert would silently drop the value at write time and the agent would read a success response while losing data.