{"record":{"id":"205cd2ca0e45ed2d","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-project-id-but-re-205cd2","errorCode":null,"errorMessage":"Expected a non-empty value for `project_id` but received {project_id!r}","messagePattern":"Expected a non-empty value for `project_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/admin/organization/projects/certificates.py","lineNumber":87,"sourceCode":"              ending with obj_foo, your subsequent call can include after=obj_foo in order to\n              fetch the next page of the list.\n\n          limit: A limit on the number of objects to be returned. Limit can range between 1 and\n              100, and the default is 20.\n\n          order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending\n              order and `desc` for descending order.\n\n          extra_headers: Send extra headers\n\n          extra_query: Add additional query parameters to the request\n\n          extra_body: Add additional JSON properties to the request\n\n          timeout: Override the client-level default timeout for this request, in seconds\n        \"\"\"\n        if not project_id:\n            raise ValueError(f\"Expected a non-empty value for `project_id` but received {project_id!r}\")\n        return self._get_api_list(\n            path_template(\"/organization/projects/{project_id}/certificates\", project_id=project_id),\n            page=SyncConversationCursorPage[CertificateListResponse],\n            options=make_request_options(\n                extra_headers=extra_headers,\n                extra_query=extra_query,\n                extra_body=extra_body,\n                timeout=timeout,\n                query=maybe_transform(\n                    {\n                        \"after\": after,\n                        \"limit\": limit,\n                        \"order\": order,\n                    },\n                    certificate_list_params.CertificateListParams,\n                ),\n                security={\"admin_api_key_auth\": True},\n            ),","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/admin/organization/projects/certificates.py#L69-L105","documentation":"The sync Certificates `list` method validates `project_id` before building `/organization/projects/{project_id}/certificates`. An empty or None project id would produce a malformed path, so the SDK raises this ValueError locally without contacting the server.","triggerScenarios":"Calling `client.admin.organization.projects.certificates.list(project_id=...)` with '', None, or whitespace; config/env-driven project id missing at runtime.","commonSituations":"Env var unset in the deployed environment; empty project field in a config store; placeholder from example code left in place.","solutions":["Provide the real project id (e.g. 'proj_abc123')","Load and validate configuration at application startup","Fail fast with a descriptive error when config values are missing"],"exampleFix":"# before\ncerts = client.admin.organization.projects.certificates.list(project_id=\"\")\n\n# after\ncerts = client.admin.organization.projects.certificates.list(project_id=\"proj_abc123\")","handlingStrategy":"validation","validationCode":"assert isinstance(project_id, str) and project_id.strip(), \"project_id required\"\ncerts = client.admin.organization.projects.certificates.list(project_id=project_id)","typeGuard":"def is_valid_project_id(v: str | None) -> bool:\n    return isinstance(v, str) and bool(v.strip())","tryCatchPattern":"try:\n    certs = client.admin.organization.projects.certificates.list(project_id=pid)\nexcept ValueError as e:\n    logger.error(\"bad project_id: %s\", e)\n    return []","preventionTips":["Validate config at startup","Centralize project id retrieval in one helper","Skip blank ids when enumerating projects"],"tags":["openai","python","validation","path-parameter","certificates","admin-api"],"backgroundTag":"missing-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}