{"record":{"id":"06325c42ff0ad1d5","repo":"denoland/deno","slug":"invalid-registry-configuration-registry-with-sche-06325c","errorCode":null,"errorMessage":"Invalid registry configuration. Registry with schema \"{}\" is missing a path parameter in schema for variable \"{}\".","messagePattern":"Invalid registry configuration\\. Registry with schema \"(.+?)\" is missing a path parameter in schema for variable \"(.+?)\"\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/lsp/registries.rs","lineNumber":343,"sourceCode":"\n    for key_name in &key_names {\n      if !registry\n        .variables\n        .iter()\n        .map(|var| var.key.to_owned())\n        .any(|x| x == *key_name)\n      {\n        return Err(anyhow!(\n          \"Invalid registry configuration. Registry with schema \\\"{}\\\" is missing variable declaration for key \\\"{}\\\".\",\n          registry.schema,\n          key_name\n        ));\n      }\n    }\n\n    for variable in &registry.variables {\n      let key_index = key_names.iter().position(|key| *key == variable.key);\n      let key_index = key_index.ok_or_else(||anyhow!(\"Invalid registry configuration. Registry with schema \\\"{}\\\" is missing a path parameter in schema for variable \\\"{}\\\".\", registry.schema, variable.key))?;\n\n      let replacement_variables = parse_replacement_variables(&variable.url);\n      let limited_keys = key_names.get(0..key_index).unwrap();\n      for v in replacement_variables {\n        if variable.key == v && config.version == 1 {\n          return Err(anyhow!(\n            \"Invalid registry configuration. Url \\\"{}\\\" (for variable \\\"{}\\\" in registry with schema \\\"{}\\\") uses variable \\\"{}\\\", which is not allowed because that would be a self reference.\",\n            variable.url,\n            variable.key,\n            registry.schema,\n            v\n          ));\n        }\n\n        let key_index = limited_keys.iter().position(|key| key == &v);\n\n        if key_index.is_none() && variable.key != v {\n          return Err(anyhow!(","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/lsp/registries.rs#L325-L361","documentation":"Inverse check of the previous one, cli/lsp/registries.rs:343: every declared variable must correspond to an actual path parameter in the schema. key_names is built from the schema's placeholders; if a variable's key is not among them, the validator errors with \"missing a path parameter in schema for variable\". This keeps the variables array from declaring completion sources that can never be reached.","triggerScenarios":"\"variables\" contains { \"key\": \"tag\" } but the schema is \"/x/:package@:version\" (no :tag placeholder); a schema rewrite that dropped a segment while the variables entry survived.","commonSituations":"Editing registry configs by duplication (copy a registry block, change the schema, forget to prune variables); schemas changed to hardcode a segment that used to be a parameter.","solutions":["Add the matching placeholder to the schema (\"/x/:package@:version\" plus \"/:tag\" if a tag variable exists)","Or delete the variable entry whose key no longer appears in the schema","Keep schema and variables adjacent in the JSON and diff them after any rename"],"exampleFix":"// before\n{ \"schema\": \"/x/:package\", \"variables\": [ { \"key\": \"package\", ... }, { \"key\": \"version\", ... } ] }\n\n// after\n{ \"schema\": \"/x/:package@:version\", \"variables\": [ { \"key\": \"package\", ... }, { \"key\": \"version\", ... } ] }","handlingStrategy":"validation","validationCode":"for (const v of r.variables) {\n  if (!schemaKeys.includes(v.key)) throw new Error(`variable '${v.key}' has no schema placeholder`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep schema and variables as one editing unit; never change one without re-checking the other","Delete variables for path segments you hardcode into the schema"],"tags":["lsp","registry","configuration","validation"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}