{"record":{"id":"51c20c4b99c7b45d","repo":"tauri-apps/tauri","slug":"invalid-json-schema-for-plugin-name-e","errorCode":null,"errorMessage":"invalid JSON schema for plugin {name}: {e}","messagePattern":"invalid JSON schema for plugin (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-utils/src/acl/schema.rs","lineNumber":269,"sourceCode":"  if let Some(Schema::Object(obj)) = root_schema.definitions.get_mut(\"PermissionEntry\") {\n    let any_of = obj.subschemas().any_of.as_mut().unwrap();\n    let Schema::Object(extend_permission_entry) = any_of.last_mut().unwrap() else {\n      unreachable!(\"PermissionsEntry should be an object not a boolean\");\n    };\n\n    // remove default properties and save it to be added later as a fallback\n    let obj = extend_permission_entry.object.as_mut().unwrap();\n    let default_properties = std::mem::take(&mut obj.properties);\n\n    let default_identifier = default_properties.get(IDENTIFIER).cloned().unwrap();\n    let default_identifier = (IDENTIFIER.to_string(), default_identifier);\n\n    let mut all_of = vec![];\n\n    let schemas = acl.iter().filter_map(|(name, manifest)| {\n      manifest\n        .global_scope_schema()\n        .unwrap_or_else(|e| panic!(\"invalid JSON schema for plugin {name}: {e}\"))\n        .map(|s| (s, manifest.gen_possible_permission_schemas(Some(name))))\n    });\n\n    for ((scope_schema, defs), acl_perm_schema) in schemas {\n      let mut perm_schema = SchemaObject::default();\n      perm_schema.subschemas().any_of = Some(acl_perm_schema);\n\n      let mut if_schema = SchemaObject::default();\n      if_schema.object().properties = [(IDENTIFIER.to_string(), perm_schema.into())].into();\n\n      let mut then_schema = SchemaObject::default();\n      then_schema.object().properties = [\n        (ALLOW.to_string(), scope_schema.clone()),\n        (DENY.to_string(), scope_schema.clone()),\n      ]\n      .into();\n\n      let mut obj = SchemaObject::default();","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-utils/src/acl/schema.rs#L251-L287","documentation":"While generating the JSON schema for capabilities/permissions (used by tooling and editor validation), Tauri collects each plugin's `global_scope_schema`. If a plugin's schema fails to deserialize as a valid JSON schema, generation panics. This indicates a broken or malformed schema inside a plugin manifest, not a problem in your app code.","triggerScenarios":"`generate_capability_schema` iterates the ACL and calls `global_scope_schema()` on each plugin manifest; a plugin ships a `global.json` (global scope schema) that fails schemars/serde validation, typically due to unsupported or malformed schema keywords.","commonSituations":"Using a third-party plugin built against an incompatible tauri/tauri-utils version; hand-editing a plugin's autogenerated schema files; a plugin release with a corrupted or outdated `permissions/` directory.","solutions":["Identify the offending plugin from the `{name}` in the message and update it to a version compatible with your Tauri version (cargo update -p <plugin>).","Regenerate the plugin's schemas by rebuilding it (its build.rs autogenerates schema files) or delete and rebuild the plugin's `permissions/schema.json`.","If it's your own plugin, fix the invalid schema in its global scope permission (usually malformed schemars output or manual edits).","Clear stale build artifacts (cargo clean) so stale autogenerated schemas are regenerated."],"exampleFix":"// before (plugin permissions/autogenerated/default.toml referencing a bad schema)\n# manually edited schema.json with unsupported \"$recursiveRef\"\n// after: regenerate\n$ cargo clean -p my-plugin && cargo build","handlingStrategy":"fallback","validationCode":"// before building, sanity check plugin schema files\nfor f in plugins/*/permissions/schema.json; do jq empty \"$f\" || echo \"invalid JSON: $f\"; done","typeGuard":null,"tryCatchPattern":"// This panics in build scripts, so guard at dependency level:\n// pin plugin versions in Cargo.toml and verify the plugin builds standalone\n// cargo build -p tauri-plugin-foo","preventionTips":["Keep tauri, tauri-utils, and all tauri-plugin-* crates on compatible versions","Never hand-edit plugin-generated schema.json files","Rebuild plugins (cargo clean) after upgrading Tauri major/minor versions"],"tags":["json-schema","plugins","acl","build"],"backgroundTag":"schema-validation-failed","analyzedSha":"460ec35447493200d64290dd7f015d5a91d0fd58","analyzedAt":"2026-09-18T23:55:51.277Z","contentChangedAt":"2026-09-18T23:55:51.277Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}