Context: In crates/connectors/src/sources/rest.rs (around line 260), there is a TODO: Build schema from config if provided. When a REST endpoint returns an empty JSON array [], Arrow inference fails because there are no fields.
Task:
- Locate
crates/connectors/src/sources/rest.rs.
- Check if the
RestSource configuration struct has a schema field provided. If schema is defined in the config, use it to instantiate an empty RecordBatch instead of failing inference when the response is [].
- Add a simple test case in the same file
#[cfg(test)] module verifying that an empty response with a predefined schema succeeds.
Context: In
crates/connectors/src/sources/rest.rs(around line 260), there is aTODO: Build schema from config if provided. When a REST endpoint returns an empty JSON array[], Arrow inference fails because there are no fields.Task:
crates/connectors/src/sources/rest.rs.RestSourceconfiguration struct has aschemafield provided. Ifschemais defined in the config, use it to instantiate an emptyRecordBatchinstead of failing inference when the response is[].#[cfg(test)]module verifying that an empty response with a predefined schema succeeds.