{"record":{"id":"9c047859afd93272","repo":"flarum/framework","slug":"invalid-includes","errorCode":null,"errorMessage":"Invalid includes [","messagePattern":"Invalid includes \\[","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"framework/core/src/Http/RequestUtil.php","lineNumber":216,"sourceCode":"        }\n\n        return $offset;\n    }\n\n    public static function extractInclude(Request $request, ?array $available): array\n    {\n        $include = $request->getQueryParams()['include'] ?? '';\n\n        if (! is_string($include)) {\n            throw new BadRequestException('include must be a string');\n        }\n\n        $includes = array_filter(explode(',', $include));\n\n        $invalid = array_diff($includes, $available);\n\n        if (count($invalid)) {\n            throw new BadRequestException('Invalid includes ['.implode(',', $invalid).']');\n        }\n\n        return $includes;\n    }\n\n    public static function extractFilter(Request $request): array\n    {\n        $filter = $request->getQueryParams()['filter'] ?? [];\n\n        if (! is_array($filter)) {\n            throw new BadRequestException('filter must be an array');\n        }\n\n        return $filter;\n    }\n\n    public static function extractFields(Request $request, ?array $available = null): array\n    {","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Http/RequestUtil.php#L198-L234","documentation":"Thrown in RequestUtil::extractInclude after splitting the include parameter: any requested relationship path not present in the endpoint's available-includes list is rejected with 400 to prevent arbitrary relationship eager loading. The message lists the offending comma-separated include paths (the recorded text is truncated; the full message is 'Invalid includes [<paths>]').","triggerScenarios":"Thrown at framework/core/src/Http/RequestUtil.php:216 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Only request include paths the endpoint documents as includable","Remove unsupported includes from the query string","If server-side is yours, allow the relationship via the endpoint's include registration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}