{"record":{"id":"bd533ce5156ae47a","repo":"quarkusio/quarkus","slug":"id-is-missing-for-category-named-builder-name","errorCode":null,"errorMessage":"id is missing for category named ${builder.name}","messagePattern":"id is missing for category named (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/catalog/CategoryImpl.java","lineNumber":35,"sourceCode":" *\n * @see Category#mutable() creates a builder from an existing Category\n * @see Category#builder() creates a builder\n * @see ExtensionCatalogImpl.Builder#getCategories() will use the builder to deserialize\n * @see JsonBuilder.JsonBuilderSerializer for building a builder before serializing it.\n */\n@JsonInclude(JsonInclude.Include.NON_DEFAULT)\n@JsonPropertyOrder({ \"id\", \"name\", \"description\", \"metadata\" })\npublic class CategoryImpl implements Category {\n\n    private final String id;\n    private final String name;\n    private final String description;\n    private final Map<String, Object> metadata;\n\n    private CategoryImpl(Builder builder) {\n        this.id = builder.id;\n        if (id == null) {\n            throw new IllegalArgumentException(\"id is missing for category named \" + builder.name);\n        }\n        this.name = builder.name;\n        this.description = builder.description;\n        this.metadata = JsonBuilder.toUnmodifiableMap(builder.metadata);\n    }\n\n    @Override\n    public String getId() {\n        return id;\n    }\n\n    @Override\n    public String getName() {\n        return name;\n    }\n\n    @Override\n    public String getDescription() {","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/catalog/CategoryImpl.java#L17-L53","documentation":"CategoryImpl's Builder.build() enforces that every category in a registry catalog carries an id; if builder.id is null it throws IllegalArgumentException including the category's name. Category ids are the keys used to group extensions, so an id-less category is invalid catalog data.","triggerScenarios":"Deserializing/building an extension catalog whose categories JSON array contains an entry with a name but no id field, then calling Builder.build() — e.g. during ExtensionCatalog.mutableFromFile() of a hand-written or corrupt registry catalog.","commonSituations":"Hand-editing a catalog JSON and dropping the id field; a registry publishing malformed categories; programmatic catalog construction with Builder.name set but Builder.id left null.","solutions":["Add the id field to the offending category in the catalog JSON (the message names the category).","If building programmatically, call Builder.id(...) before build().","Report the malformed catalog to the registry operator that published it.","Validate catalog JSON against the schema before loading (jq check for .id in each category)."],"exampleFix":"// before (catalog JSON)\n{\"categories\": [{\"name\": \"Data\", \"description\": \"...\"}]}\n// after\n{\"categories\": [{\"id\": \"data\", \"name\": \"Data\", \"description\": \"...\"}]}","handlingStrategy":"validation","validationCode":"// Before loading a catalog JSON you authored, validate each category has an id:\n// jq -e '.categories | all(has(\"id\"))' catalog.json","typeGuard":null,"tryCatchPattern":"// Java\ntry {\n    catalog = ExtensionCatalog.mutableFromFile(json);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"id is missing for category\")) {\n        logger.error(\"Malformed catalog: \" + e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Always set id (kebab-case) next to name when authoring category entries.","Validate catalog JSON against the Quarkus registry schema before publishing.","When using CategoryImpl.Builder, call id(...) before build() — treat it as required.","Report id-less categories to the registry publisher; it is invalid data."],"tags":["json","catalog","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}