{"record":{"id":"1702b02d450a053d","repo":"sgl-project/sglang","slug":"path-must-be-a-non-empty-string","errorCode":null,"errorMessage":"{path} must be a non-empty string","messagePattern":"(.+?) must be a non-empty string","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/request_validation.py","lineNumber":48,"sourceCode":"    MINIMAX_H3_TASK_T2VA,\n    MiniMaxH3TaskProfile,\n    canonical_minimax_h3_task,\n    minimax_h3_task_profile,\n)\nfrom sglang.multimodal_gen.runtime.pipelines_core.stages.model_specific_stages.minimax_h3.time_request import (\n    minimax_h3_align_frame_count,\n)\n\nMINIMAX_H3_REQUEST_SCHEMA = \"minimax_h3.request/v1\"\nMINIMAX_H3_MAX_SIGNED_SEED = (1 << 63) - 1\n_ALLOWED_CONDITION_KEYS = frozenset(\n    {\"type\", \"uri\", \"role\", \"frame_index\", \"start_time_seconds\"}\n)\n\n\ndef _require_str(value: Any, path: str) -> str:\n    if not isinstance(value, str) or value == \"\":\n        raise ValueError(f\"{path} must be a non-empty string\")\n    return value\n\n\ndef _require_int(value: Any, path: str) -> int:\n    if isinstance(value, bool) or not isinstance(value, int):\n        raise ValueError(f\"{path} must be an integer\")\n    return value\n\n\ndef _optional_positive_finite_float(value: Any, path: str) -> float | None:\n    if value is None:\n        return None\n    if isinstance(value, bool) or not isinstance(value, (int, float)):\n        raise ValueError(f\"{path} must be a number\")\n    normalized = float(value)\n    if not math.isfinite(normalized) or normalized <= 0.0:\n        raise ValueError(f\"{path} must be a positive finite number\")\n    return normalized","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/request_validation.py#L30-L66","documentation":"The canonical-request validator requires certain string fields (identified by the JSON path in the message) to be non-empty strings. _require_str rejects None, non-str types, and empty strings.","triggerScenarios":"Calling minimax_h3_validate_canonical_request (or _validate_target/_validate_conditions) with e.g. target.uri = None, type = 3, or role = \"\" — the message names the exact path.","commonSituations":"Partial request payloads, optional fields serialized as null by a JSON client, or fields dropped then defaulted to None upstream.","solutions":["Find the field at the path in the message and supply a non-empty string","Treat these fields as required in your client schema, not nullable","Strip nulls before validation if your transport inserts them"],"exampleFix":"# before\n{\"target\": {\"uri\": None}}\n# after\n{\"target\": {\"uri\": \"file://video.mp4\"}}","handlingStrategy":"type-guard","validationCode":"def clean(req: dict) -> dict:\n    for p in [\"target.uri\", \"target.type\", \"target.role\"]:\n        v = get_path(req, p)\n        assert isinstance(v, str) and v, f\"{p} must be a non-empty string\"\n    return req","typeGuard":"def non_empty_str(v: Any) -> bool:\n    return isinstance(v, str) and v != \"\"","tryCatchPattern":null,"preventionTips":["Use a typed client model (pydantic) for canonical requests","Reject nulls for required string fields at deserialization"],"tags":["minimax-h3","request-validation","string-field","canonical-request"],"backgroundTag":"schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}