{"record":{"id":"aaa2dc4b4f252e90","repo":"pentaho/pentaho-kettle","slug":"annotation-id","errorCode":null,"errorMessage":"Annotation.id","messagePattern":"Annotation\\.id","errorType":"validation","errorClass":"ArgumentRequiredError","httpStatus":null,"severity":"error","filePath":"plugins/core-ui/src/main/resources/app/pentaho/_core/module/Meta.js","lineNumber":677,"sourceCode":"     * @param {Class.<pentaho.module.Annotation>|string} Annotation - The annotation class or identifier.\n     *\n     * @return {string} The annotation identifier.\n     *\n     * @throws {pentaho.lang.ArgumentRequiredError} When the `Annotation` argument is _nully_.\n     * @throws {pentaho.lang.ArgumentRequiredError} When the `Annotation` argument does not have an `id` property.\n     */\n    function getAnnotationId(Annotation) {\n      if(Annotation == null) {\n        throw new ArgumentRequiredError(\"Annotation\");\n      }\n\n      if(typeof Annotation === \"string\") {\n        return Annotation;\n      }\n\n      var annotationId = Annotation.id;\n      if(annotationId == null) {\n        throw new ArgumentRequiredError(\"Annotation.id\");\n      }\n\n      return annotationId;\n    }\n    // endregion\n  };\n});\n","sourceCodeStart":659,"sourceCodeEnd":685,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core-ui/src/main/resources/app/pentaho/_core/module/Meta.js#L659-L685","documentation":"pentaho.lang.ArgumentRequiredError thrown by getAnnotationId when the passed Annotation object has no `id` property (undefined or null). Since the annotation is an object (not a string), the library reads `.id` to identify it and treats a missing id as a required argument violation nested under `Annotation.id`.","triggerScenarios":"Passing an anonymous or malformed object (e.g. a plain {} or a class created without declaring `id` via Annotation(...) specification) to annotationId/getAnnotationId.","commonSituations":"Defining a custom annotation class but forgetting to declare its `id`; passing the wrong object (an instance instead of the annotation class); typos in the id property name.","solutions":["Declare an `id` on the annotation class via its Annotation specification.","Pass the annotation id string directly instead of the class object.","Verify you are passing the annotation class, not an arbitrary object."],"exampleFix":"// before\nvar MyAnno = Annotation.extend({});\nmetaService.annotationId(MyAnno);\n// after\nvar MyAnno = Annotation.extend({ id: \"my/annotation\" });\nmetaService.annotationId(MyAnno); // or annotationId(\"my/annotation\")","handlingStrategy":"validation","validationCode":"if(Annotation != null && typeof Annotation !== \"string\" && Annotation.id == null) {\n  throw new Error(\"Annotation class must declare an id\");\n}","typeGuard":"function isAnnotationWithId(a) { return typeof a === \"string\" || (a != null && a.id != null); }","tryCatchPattern":"try { id = metaService.annotationId(ann); } catch(e) { if(e.name === \"pentaho.lang.ArgumentRequiredError\") { console.warn(\"annotation missing id\", ann); id = null; } else { throw e; } }","preventionTips":["Always declare `id` in every Annotation.extend specification","Prefer passing the annotation id string directly when available"],"tags":["missing-property","annotation","argument-required"],"backgroundTag":"missing-required-argument","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}