{"record":{"id":"512eedf43c809bc9","repo":"HMCL-dev/HMCL","slug":"unsupported-theme-pack-schema-schema","errorCode":null,"errorMessage":"Unsupported theme-pack schema: ${schema}","messagePattern":"Unsupported theme-pack schema: (.+?)","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/theme/ThemePackManifest.java","lineNumber":278,"sourceCode":"        return id;\n    }\n\n    static final class Adapter implements JsonSerializer<@Nullable ThemePackManifest>,\n            JsonDeserializer<@Nullable ThemePackManifest> {\n\n        @Override\n        public @Nullable ThemePackManifest deserialize(\n                @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);","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/theme/ThemePackManifest.java#L260-L296","documentation":"After confirming the manifest is a JsonObject, deserialize checks it against CURRENT_SCHEMA via JsonSchema.check; if the schema is not \"readable\" (schema property missing or an incompatible version), it throws JsonParseException naming the schema value found in the manifest. This gates packs written for older/newer manifest formats.","triggerScenarios":"A manifest with \"schema\" set to an unsupported version string, a non-string schema value (JsonElement is interpolated, so it may print as \"...\"), or the schema property omitted entirely.","commonSituations":"Opening a theme pack produced by a newer HMCL version than the running one; hand-written manifests missing the schema field; schema copied from another pack format.","solutions":["Update HMCL to a version whose CURRENT_SCHEMA can read the pack's declared schema.","Set the manifest's \"schema\" field to the value supported by your HMCL build (see CURRENT_SCHEMA).","If the schema value is garbage/non-string, fix it to the expected version string and repack."],"exampleFix":"// before\n\"schema\": 2\n// after\n\"schema\": \"1\"","handlingStrategy":"try-catch","validationCode":"String schema = obj.has(\"schema\") && obj.get(\"schema\").isJsonPrimitive() ? obj.get(\"schema\").getAsString() : null;","typeGuard":null,"tryCatchPattern":"try { return deserializeManifest(object); } catch (JsonParseException e) { promptUserToUpdateHMCL(); }","preventionTips":["Pin the \"schema\" field to the version your HMCL build supports","Update HMCL before opening packs from newer releases","Check CURRENT_SCHEMA when authoring packs"],"tags":["theme-pack","schema","versioning"],"backgroundTag":"schema-validation-failed","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"}