{"record":{"id":"566c08c2aed8b3ba","repo":"HMCL-dev/HMCL","slug":"theme-pack-manifest-is-missing-name","errorCode":null,"errorMessage":"Theme-pack manifest is missing name","messagePattern":"Theme-pack manifest is missing name","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/theme/ThemePackManifest.java","lineNumber":286,"sourceCode":"                @Nullable JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {\n            if (json == null || json instanceof JsonNull) {\n                return null;\n            }\n\n            if (!(json instanceof JsonObject object)) {\n                throw new JsonParseException(\"Theme-pack manifest is not a JsonObject\");\n            }\n\n            if (!JsonSchema.check(object, CURRENT_SCHEMA).readable()) {\n                throw new JsonParseException(\"Unsupported theme-pack schema: \" + object.get(JsonSchema.PROPERTY_SCHEMA));\n            }\n\n            String id = requireMemberString(object, \"id\");\n            String version = requireMemberString(object, \"version\");\n\n            LocalizedText name = context.deserialize(object.get(\"name\"), LocalizedText.class);\n            if (name == null) {\n                throw new JsonParseException(\"Theme-pack manifest is missing name\");\n            }\n\n            @Nullable LocalizedText description;\n            try {\n                description = context.deserialize(object.get(\"description\"), LocalizedText.class);\n                if (description != null) {\n                    description = requireLocalizedText(description, \"description\");\n                }\n            } catch (JsonParseException | IllegalArgumentException e) {\n                LOG.warning(\"Ignored invalid theme-pack description\", e);\n                description = null;\n            }\n\n            List<ThemePackAuthor> authors;\n            try {\n                authors = ThemePackAuthor.parseAuthors(object.get(\"authors\"));\n            } catch (JsonParseException | IllegalArgumentException e) {\n                LOG.warning(\"Ignored invalid theme-pack authors\", e);","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/theme/ThemePackManifest.java#L268-L304","documentation":"deserialize requires a \"name\" member that unmarshals to a non-null LocalizedText; when the member is absent, JSON null, or deserializes to null, JsonParseException \"Theme-pack manifest is missing name\" is thrown. Unlike description, name is mandatory because every theme pack needs a display name.","triggerScenarios":"Manifest without a \"name\" key; \"name\": null; or a name value that the LocalizedText deserializer rejects/turns into null (e.g. wrong shape instead of string or {zh_CN:...}-style map).","commonSituations":"Stripping fields while editing a pack; a localization tool that wrote an empty name object; template manifests with name left as a placeholder null.","solutions":["Add a valid \"name\" member to theme_pack.json, either a plain string or the localized map form.","If a localization tool emitted null, fix its export so name is serialized.","Repack the zip after editing and retry the load."],"exampleFix":"// before\n{ \"id\": \"x\", \"version\": \"1.0.0\" }\n// after\n{ \"id\": \"x\", \"version\": \"1.0.0\", \"name\": \"My Theme\" }","handlingStrategy":"validation","validationCode":"boolean hasName = obj.has(\"name\") && !obj.get(\"name\").isJsonNull() && (obj.get(\"name\").isJsonPrimitive() || obj.get(\"name\").isJsonObject());","typeGuard":null,"tryCatchPattern":"try { ThemePackManifest m = parse(json); } catch (JsonParseException e) { reportMissingField(\"name\"); }","preventionTips":["Always include a non-null \"name\" in manifests","Verify localization tooling exports non-empty names","Diff edited manifests against a known-good template"],"tags":["theme-pack","manifest","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}