{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/planetaryescape/mxr/crates/mail-threading/testdata/schema.json",
"title": "mail-threading conformance fixture",
"type": "object",
"required": ["name", "description", "spec", "input", "expected"],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "minLength": 1 },
"description": { "type": "string", "minLength": 1 },
"spec": {
"type": "object",
"required": ["source", "url", "behavior"],
"additionalProperties": false,
"properties": {
"source": { "type": "string", "minLength": 1 },
"url": { "type": "string", "format": "uri" },
"behavior": { "type": "string", "minLength": 1 }
}
},
"options": {
"type": "object",
"additionalProperties": false,
"properties": {
"subject_merge": { "type": "boolean" },
"prune_phantoms": { "type": "boolean" },
"subject_prefixes": {
"type": "array",
"items": { "type": "string", "minLength": 1 }
}
}
},
"input": {
"type": "array",
"items": { "$ref": "#/$defs/message" }
},
"expected": {
"type": "object",
"required": ["threads"],
"additionalProperties": false,
"properties": {
"threads": {
"type": "array",
"items": { "$ref": "#/$defs/thread" }
}
}
}
},
"$defs": {
"message": {
"type": "object",
"required": ["id", "message_id", "references", "subject", "date"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"message_id": {
"anyOf": [
{ "type": "string", "minLength": 1 },
{ "type": "null" }
]
},
"in_reply_to": { "type": ["string", "null"] },
"references": {
"type": "array",
"items": { "type": "string", "minLength": 1 }
},
"subject": { "type": "string" },
"date": { "type": "string", "format": "date-time" }
}
},
"thread": {
"type": "object",
"required": ["root", "messages"],
"additionalProperties": false,
"properties": {
"root": { "type": "string", "minLength": 1 },
"messages": {
"type": "array",
"items": { "type": "string", "minLength": 1 }
}
}
}
}
}