{"record":{"id":"3e6fd78ccbff066e","repo":"theonedev/onedev","slug":"dependency-property-not-found-x","errorCode":null,"errorMessage":"Dependency property not found: X","messagePattern":"Dependency property not found: X","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/ai/BuildSpecSchema.java","lineNumber":250,"sourceCode":"                }\n            }\n        }\n        if (!dependents.isEmpty()) {\n            var allOfNode = new ArrayList<Map<String, Object>>();\n            currentNode.put(\"allOf\", allOfNode);\n            for (var dependent: dependents) {\n                var allOfItemNode = new HashMap<String, Object>();\n                allOfNode.add(allOfItemNode);\n                var dependsOns = dependent.getRight();\n                \n                var ifNode = new HashMap<String, Object>();\n                allOfItemNode.put(\"if\", ifNode);\n                var ifAllOfNode = new ArrayList<Map<String, Object>>();\n                ifNode.put(\"allOf\", ifAllOfNode);\n                for (var dependsOn: dependsOns) {\n                    var dependencyProperty = propertyMap.get(dependsOn.property());\n                    if (dependencyProperty == null) \n                        throw new ExplicitException(\"Dependency property not found: \" + dependsOn.property());\n                    ifAllOfNode.add(buildDependsOnCondition(dependsOn, dependencyProperty));\n                }\n\n                var branchNode = new HashMap<String, Object>();\n                allOfItemNode.put(\"then\", branchNode);\n\n                var property = dependent.getLeft();\n                var branchPropsNode = new HashMap<String, Object>();\n                branchNode.put(\"properties\", branchPropsNode);\n                var propNode = new HashMap<String, Object>();\n                branchPropsNode.put(property.getPropertyName(), propNode);\n                processProperty(propNode, bean, property);\n                if (property.isPropertyRequired()) {\n                    var requiredList = new ArrayList<String>();\n                    requiredList.add(property.getPropertyName());\n                    branchNode.put(\"required\", requiredList);\n                }\n            }","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/ai/BuildSpecSchema.java#L232-L268","documentation":"A bean property annotated @DependsOn(property=\"...\") references another property that must exist in the same bean so the schema can emit an if/then condition. processBean throws this ExplicitException when the referenced dependency property is not found in the bean's property map.","triggerScenarios":"A @DependsOn annotation on a spec property names a property string that does not match any actual property of the bean, so propertyMap.get(dependsOn.property()) returns null.","commonSituations":"Typo in the @DependsOn value, renaming/removing the dependency property without updating annotations, or referencing a property inherited/excluded from schema processing.","solutions":["Correct the @DependsOn annotation value to exactly match the dependency property's name.","Restore or rename the referenced property if it was deleted or renamed.","Verify the dependency property is not excluded from schema processing in the enclosing processBean call."],"exampleFix":"// before\n@DependsOn(property=\"executorTyp\")\npublic String getImage() {...}\n// after\n@DependsOn(property=\"executorType\")\npublic String getImage() {...}","handlingStrategy":"validation","validationCode":"for (var p : properties) {\n    for (var d : p.getAnnotationsByType(DependsOn.class)) {\n        if (!propertyNames.contains(d.property()))\n            throw new IllegalStateException(\"@DependsOn target missing: \" + d.property());\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    schema = BuildSpecSchema.generate(specClass);\n} catch (ExplicitException e) {\n    if (e.getMessage().startsWith(\"Dependency property not found\")) {\n        // fix the @DependsOn value named in the message\n    }\n}","preventionTips":["Keep @DependsOn values in sync when renaming properties.","Grep bean classes for @DependsOn during refactors.","Add schema-generation tests covering dependency annotations."],"tags":["schema","annotations","buildspec","dependency"],"backgroundTag":"schema-validation-failed","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}