Skip to main content

infer_schema_from_json

Function infer_schema_from_json 

Source
pub fn infer_schema_from_json(
    sample: &[u8],
) -> Result<SchemaRef, ConnectorError>
Expand description

Creates a default schema for JSON messages when no explicit schema is provided.

Uses schema inference from the first message. If json_path is provided, navigates into the object before inferring fields.

ยงErrors

Returns ConnectorError::Serde if the sample is not valid UTF-8 or valid JSON, or if the top-level value is not a JSON object.