{"record":{"id":"5745dbe89b54f222","repo":"HMCL-dev/HMCL","slug":"servermodpackmanifest-fileapi-cannot-be-blank","errorCode":null,"errorMessage":"ServerModpackManifest.fileApi cannot be blank","messagePattern":"ServerModpackManifest\\.fileApi cannot be blank","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/server/ServerModpackManifest.java","lineNumber":97,"sourceCode":"    }\n\n    public List<ModpackConfiguration.FileInformation> getFiles() {\n        return files;\n    }\n\n    public List<Addon> getAddons() {\n        return addons;\n    }\n\n    @Override\n    public ModpackProvider getProvider() {\n        return ServerModpackProvider.INSTANCE;\n    }\n\n    @Override\n    public void validate() throws JsonParseException, TolerableValidationException {\n        if (fileApi == null)\n            throw new JsonParseException(\"ServerModpackManifest.fileApi cannot be blank\");\n        if (files == null)\n            throw new JsonParseException(\"ServerModpackManifest.files cannot be null\");\n    }\n\n    public static final class Addon {\n        private final String id;\n        private final String version;\n\n        public Addon() {\n            this(\"\", \"\");\n        }\n\n        public Addon(String id, String version) {\n            this.id = id;\n            this.version = version;\n        }\n\n        public String getId() {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/server/ServerModpackManifest.java#L79-L115","documentation":"Validation error thrown when parsing a server modpack manifest (modpack.json) whose 'fileApi' field is missing (null). The fileApi URL is mandatory because the client needs it to download the modpack's files, so the manifest is rejected as invalid.","triggerScenarios":"ServerModpackManifest.validate() runs after JSON deserialization and fileApi is null — the manifest JSON omits the 'fileApi' key or it was explicitly set to null.","commonSituations":"Hand-edited or truncated manifest files; a server operator generating manifests with a buggy tool; downloading a manifest over a broken connection that cut off part of the JSON.","solutions":["Add the required 'fileApi' field (base URL of the file server) to the manifest JSON.","Re-download the manifest from the server; the copy may be truncated or corrupted.","If you run the server, fix your manifest-generation tool to always emit 'fileApi'."],"exampleFix":"// before\n{ \"name\": \"my pack\", \"files\": [...] }\n// after\n{ \"name\": \"my pack\", \"fileApi\": \"https://example.com/files\", \"files\": [...] }","handlingStrategy":"validation","validationCode":"JsonObject manifest = JsonUtils.fromJson(json, JsonObject.class);\nif (!manifest.has(\"fileApi\") || manifest.get(\"fileApi\").isJsonNull())\n    throw new JsonParseException(\"manifest missing fileApi\");","typeGuard":null,"tryCatchPattern":"try {\n    manifest.validate();\n} catch (JsonParseException e) {\n    if (e.getMessage().contains(\"fileApi cannot be blank\")) {\n        // re-download or fix the manifest\n    }\n}","preventionTips":["Always include 'fileApi' in generated manifests.","Validate manifests with a JSON schema before publishing.","Re-download manifests instead of hand-repairing truncated files."],"tags":["modpack","json","validation","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-15T23:17:13.987Z"}