feat: update metadata field names to use mime_type and mime_encoding

This commit is contained in:
Andrew Phillips
2025-08-18 09:44:27 -03:00
committed by Andrew Phillips (aider)
parent 18a3f1b36e
commit 05b2c1b9bd
3 changed files with 64 additions and 13 deletions

View File

@@ -89,7 +89,7 @@ pub struct ItemInfo {
pub compression: String,
#[schema(example = json!(["important", "work", "document"]))]
pub tags: Vec<String>,
#[schema(example = json!({"file.mime": "text/plain", "file.encoding": "utf-8", "line_count": "42"}))]
#[schema(example = json!({"mime_type": "text/plain", "mime_encoding": "utf-8", "line_count": "42"}))]
pub metadata: HashMap<String, String>,
}
@@ -97,7 +97,7 @@ pub struct ItemInfo {
#[schema(description = "Item information including content and metadata, with binary detection")]
pub struct ItemContentInfo {
#[serde(flatten)]
#[schema(example = json!({"file.mime": "text/plain", "file.encoding": "utf-8", "line_count": "42"}))]
#[schema(example = json!({"mime_type": "text/plain", "mime_encoding": "utf-8", "line_count": "42"}))]
pub metadata: HashMap<String, String>,
#[schema(example = "Hello, world!\nThis is the content of the file.")]
pub content: Option<String>,