{"record":{"id":"3d05f1a3291be6ab","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-certificate-id-bu","errorCode":null,"errorMessage":"Expected a non-empty value for `certificate_id` but received {certificate_id!r}","messagePattern":"Expected a non-empty value for `certificate_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/admin/organization/certificates.py","lineNumber":136,"sourceCode":"        \"\"\"\n        Get a certificate that has been uploaded to the organization.\n\n        You can get a certificate regardless of whether it is active or not.\n\n        Args:\n          include: A list of additional fields to include in the response. Currently the only\n              supported value is `content` to fetch the PEM content of the certificate.\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 certificate_id:\n            raise ValueError(f\"Expected a non-empty value for `certificate_id` but received {certificate_id!r}\")\n        return self._get(\n            path_template(\"/organization/certificates/{certificate_id}\", certificate_id=certificate_id),\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({\"include\": include}, certificate_retrieve_params.CertificateRetrieveParams),\n                security={\"admin_api_key_auth\": True},\n            ),\n            cast_to=Certificate,\n        )\n\n    def update(\n        self,\n        certificate_id: str,\n        *,\n        name: str | Omit = omit,","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/admin/organization/certificates.py#L118-L154","documentation":"The sync Admin Certificates `retrieve` method requires a non-empty `certificate_id`; the GET /organization/certificates/{certificate_id} path cannot be built without it, so the SDK raises ValueError immediately.","triggerScenarios":"client.admin.certificates.retrieve('') or retrieve(None), e.g. parsing an id from a filename or URL that didn't match.","commonSituations":"Extracting certificate ids with a regex/split that yields '' on unexpected input, or storing certificates without persisting the returned id.","solutions":["Capture the id from the create() response and persist it","Validate non-empty before calling retrieve"],"exampleFix":"# before\nclient.admin.certificates.retrieve(parsed_id)\n# after\nif not parsed_id:\n    raise ValueError('failed to parse certificate id')\nclient.admin.certificates.retrieve(parsed_id)","handlingStrategy":"validation","validationCode":"if not certificate_id:\n    raise ValueError('certificate_id is required')\nclient.admin.certificates.retrieve(certificate_id)","typeGuard":"def is_nonempty_id(v: object) -> bool:\n    return isinstance(v, str) and bool(v.strip())","tryCatchPattern":null,"preventionTips":["Persist ids returned from create()","Test id-parsing logic against unexpected formats"],"tags":["admin","certificates","path-parameter","validation"],"backgroundTag":"missing-resource-id","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}