{
"$comment": "Auto-generated by alef -- do not edit by hand. Regenerated by `alef e2e init`.",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Alef E2E Test Fixture",
"description": "Schema for alef e2e test fixture files. Each file contains either a single fixture object or an array of fixtures.",
"oneOf": [{ "$ref": "#/$defs/fixture" }, { "type": "array", "items": { "$ref": "#/$defs/fixture" } }],
"$defs": {
"fixture": {
"type": "object",
"required": ["id", "description"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9_]*$",
"description": "Unique snake_case identifier used as the test function name"
},
"category": {
"type": "string",
"description": "Test category. Defaults to parent directory name if omitted"
},
"description": { "type": "string", "description": "Human-readable test description" },
"docs": {
"type": "object",
"required": ["topic"],
"additionalProperties": false,
"properties": {
"topic": { "type": "string" },
"stem": { "type": "string" },
"paths": {
"type": "object",
"additionalProperties": { "type": "string" }
},
"title": { "type": "string" },
"description": { "type": "string" },
"input": {},
"shows": {
"type": "array",
"items": { "type": "string", "minLength": 1 }
},
"error": { "type": "boolean", "default": false },
"presentation": { "$ref": "#/$defs/docs_presentation" },
"client": { "$ref": "#/$defs/docs_client" },
"coverage_exceptions": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": ["reason", "documentation"],
"additionalProperties": false,
"properties": {
"reason": { "type": "string", "minLength": 1 },
"documentation": { "type": "string", "minLength": 1 }
}
}
},
"side_effects": { "enum": ["safe", "network", "process", "install", "server"] }
}
},
"requirements": {
"type": "array",
"items": { "type": "string", "pattern": "^(feature|model|service|credential):[^:]+$" }
},
"tags": {
"type": "array",
"items": { "type": "string" },
"description": "Optional tags for filtering"
},
"skip": { "$ref": "#/$defs/skip" },
"env": { "$ref": "#/$defs/env" },
"setup": {
"type": "array",
"items": { "$ref": "#/$defs/setup_call" },
"description": "Setup calls executed before the main call"
},
"call": {
"type": "string",
"description": "Named call config to use. References [e2e.calls.<name>]. Defaults to [e2e.call] when omitted"
},
"input": {
"type": "object",
"description": "Input data passed to the function under test. Fields map to args via [e2e.call.args] config"
},
"preserve_input_urls": {
"type": "boolean",
"default": false,
"description": "Pass this fixture's declared URLs to the call verbatim instead of substituting the mock server address. mock_url and mock_url_list args otherwise ignore input.url/input.urls entirely, which silently rewrites the subject of any test whose point is the address itself (SSRF policy, scheme rejection, host parsing). Opt in per fixture; there is deliberately no absolute-URL heuristic"
},
"config": {
"description": "Optional fixture-level config mirrored into input.config before code generation"
},
"mock_response": { "$ref": "#/$defs/mock_response" },
"visitor": {
"type": "object",
"description": "Visitor callback specification for visitor-pattern tests"
},
"args": {
"type": "array",
"items": { "$ref": "#/$defs/arg_mapping" },
"description": "Fixture-level argument mappings. When present, overrides the resolved call args"
},
"assertion_recipes": {
"type": "array",
"items": { "type": "string" },
"description": "Assertion recipes enabled for domain-shaped assertion shortcuts and streaming pseudo-fields"
},
"assertions": {
"type": "array",
"items": { "$ref": "#/$defs/assertion" },
"description": "List of assertions to check on the result"
},
"http": {
"type": "object",
"description": "HTTP server fixture specification"
}
}
},
"docs_presentation": {
"type": "object",
"additionalProperties": false,
"properties": {
"call": { "type": "string" },
"input": {},
"args": {
"type": "array",
"items": { "$ref": "#/$defs/arg_mapping" }
},
"files": {
"type": "array",
"items": { "$ref": "#/$defs/docs_file_input" }
},
"operations": {
"type": "array",
"items": { "$ref": "#/$defs/docs_operation" }
}
}
},
"docs_client": {
"type": "object",
"description": "How the documentation snippet constructs its client. Docs-only: it never affects the generated e2e suite, whose client must keep pointing at the mock server.",
"additionalProperties": false,
"properties": {
"base_url": {
"type": "string",
"minLength": 1,
"format": "uri",
"description": "Base URL the snippet's client is constructed with. Each binding wraps it in its own optional syntax."
},
"args": {
"type": "object",
"description": "Verbatim argument expressions following the base URL, keyed by binding language (rust, java, ...). Overrides client_factory_trailing_args for this fixture only.",
"additionalProperties": {
"type": "array",
"items": { "type": "string", "minLength": 1 }
}
}
}
},
"docs_file_input": {
"type": "object",
"required": ["field", "path"],
"additionalProperties": false,
"properties": {
"field": { "type": "string" },
"path": { "type": "string" }
}
},
"docs_operation": {
"oneOf": [
{
"type": "object",
"required": ["op", "path"],
"additionalProperties": false,
"properties": {
"op": { "const": "show" },
"path": { "type": "string" },
"display": { "type": "boolean" }
}
},
{
"type": "object",
"required": ["op", "path", "item"],
"additionalProperties": false,
"properties": {
"op": { "const": "iterate" },
"path": { "type": "string" },
"item": { "type": "string" },
"fields": {
"type": "array",
"items": { "type": "string" }
},
"display": { "type": "boolean" },
"optional": { "type": "boolean" }
}
}
]
},
"env": {
"type": "object",
"additionalProperties": false,
"properties": {
"api_key_var": { "type": "string" }
}
},
"setup_call": {
"type": "object",
"required": ["call"],
"additionalProperties": false,
"properties": {
"call": { "type": "string" },
"input": {}
}
},
"mock_response": {
"type": "object",
"required": ["status"],
"additionalProperties": false,
"properties": {
"status": { "type": "integer", "minimum": 100, "maximum": 599 },
"body": {},
"stream_chunks": {
"type": "array",
"items": {}
},
"headers": {
"type": "object",
"additionalProperties": { "type": "string" }
}
}
},
"arg_mapping": {
"type": "object",
"required": ["name", "field"],
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"field": { "type": "string" },
"type": { "type": "string" },
"arg_type": { "type": "string" },
"optional": { "type": "boolean" },
"owned": { "type": "boolean" },
"element_type": { "type": "string" },
"go_type": { "type": "string" },
"vec_inner_is_ref": { "type": "boolean" },
"trait_name": { "type": "string" },
"trait": { "type": "string" }
}
},
"skip": {
"type": "object",
"additionalProperties": false,
"properties": {
"languages": {
"type": "array",
"items": { "type": "string" },
"description": "Languages to skip. Empty array means skip all"
},
"reason": { "type": "string", "description": "Human-readable reason for skipping" }
}
},
"assertion": {
"type": "object",
"required": ["type"],
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"enum": [
"not_error",
"error",
"equals",
"not_equals",
"contains",
"contains_all",
"contains_any",
"not_contains",
"not_empty",
"is_empty",
"starts_with",
"ends_with",
"min_length",
"max_length",
"count_min",
"count_equals",
"matches_regex",
"is_true",
"is_false",
"greater_than",
"less_than",
"greater_than_or_equal",
"less_than_or_equal",
"method_result"
],
"description": "Assertion type"
},
"field": {
"type": "string",
"description": "Dot-separated field path on the result object"
},
"value": { "description": "Expected value (type depends on assertion type)" },
"values": {
"type": "array",
"description": "Expected values (for contains_all, contains_any, not_contains)"
},
"method": { "type": "string", "description": "Method name to call on the result" },
"check": {
"type": "string",
"description": "Assertion check type for the method result (equals, is_true, is_false, greater_than_or_equal, count_min)"
},
"args": { "description": "Arguments to pass to the method call" },
"return_type": {
"type": "string",
"description": "Return type hint for generated assertion code"
},
"skip": {
"description": "Explicit acknowledgement that this assertion cannot be generated. An assertion whose field does not resolve fails generation by default; declaring it here is the only way to keep such an assertion, and the skip is still counted -- bucketed by `kind` -- in the end-of-run summary. Use `true` for every language, or an object to scope it.",
"oneOf": [
{ "type": "boolean" },
{
"type": "object",
"additionalProperties": false,
"properties": {
"languages": {
"type": "array",
"items": { "type": "string" },
"description": "Languages this assertion is skipped for (empty means all)"
},
"kind": {
"type": "string",
"enum": ["not_representable", "language_limitation"],
"default": "not_representable",
"description": "Which backlog this skip belongs to. `not_representable`: alef cannot express this assertion shape yet -- an assertion *kind* such as \"the call returned an error\", a property of the call rather than the result, or an assertion over a stream's event sequence. `language_limitation`: the target language, ABI or binding genuinely cannot reach the field."
},
"reason": {
"type": "string",
"description": "Why this assertion cannot be expressed here"
}
}
}
]
}
}
}
}
}