{"record":{"id":"d7901eeaa2a64e94","repo":"alibaba/spring-ai-alibaba","slug":"invalid-config","errorCode":null,"errorMessage":"Invalid config!","messagePattern":"Invalid config!","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/service/dsl/adapters/StudioDSLAdapter.java","lineNumber":322,"sourceCode":"\n\t@Override\n\tpublic void validateDSLData(Map<String, Object> data) {\n\t\tString type = MapReadUtil.getMapDeepValue(data, String.class, \"type\");\n\t\tif (!\"workflow\".equalsIgnoreCase(type)) {\n\t\t\tthrow new UnsupportedOperationException(\"Unsupported type: \" + type);\n\t\t}\n\n\t\tMap<?, ?> config = MapReadUtil.getMapDeepValue(data, Map.class, \"config\");\n\t\tif (config == null) {\n\t\t\tthrow new IllegalArgumentException(\"config is null\");\n\t\t}\n\n\t\t// 检查config是否为WorkflowConfig\n\t\ttry {\n\t\t\tOBJECT_MAPPER.convertValue(config, WorkflowConfig.class);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new IllegalArgumentException(\"Invalid config!\");\n\t\t}\n\t}\n\n\t@Override\n\tpublic Serializer getSerializer() {\n\t\treturn this.serializer;\n\t}\n\n\t@Override\n\tpublic Boolean supportDialect(DSLDialectType dialectType) {\n\t\treturn DSLDialectType.STUDIO.equals(dialectType);\n\t}\n\n}\n","sourceCodeStart":304,"sourceCodeEnd":337,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/builder/generator/service/dsl/adapters/StudioDSLAdapter.java#L304-L337","documentation":"Thrown by StudioDSLAdapter.validateDSLData when Jackson's OBJECT_MAPPER.convertValue fails to deserialize the 'config' map into a WorkflowConfig object. The config exists but its internal shape does not match the WorkflowConfig schema — wrong field types, unknown required structure, or malformed nested nodes/edges. The original Jackson exception is swallowed, so the message omits the underlying reason.","triggerScenarios":"config present but with fields of wrong types (e.g. nodes as a map instead of a list); config from an older/newer Studio version whose schema diverged from WorkflowConfig; hand-authored config missing required WorkflowConfig properties or containing type-incompatible values.","commonSituations":"Migrating DSLs across Studio versions with schema changes; manual edits to nodes/edges introducing type errors; programmatically built config maps that don't mirror WorkflowConfig fields.","solutions":["Run OBJECT_MAPPER.convertValue(config, WorkflowConfig.class) yourself and log the Jackson exception to see the exact mismatching field","Compare your config against a freshly exported Studio workflow DSL and align the schema","Fix field types in config (lists vs maps, string vs number) to match WorkflowConfig","Re-export from the same Studio version as the admin runtime to avoid schema drift"],"exampleFix":"// before\n{\"config\": {\"nodes\": {\"0\": {...}}}}\n\n// after\n{\"config\": {\"nodes\": [{...}, {...}]}}","handlingStrategy":"validation","validationCode":"try {\n    new ObjectMapper().convertValue(dslData.get(\"config\"), WorkflowConfig.class);\n} catch (IllegalArgumentException e) {\n    throw new IllegalStateException(\"config does not match WorkflowConfig schema: \" + e.getMessage());\n}","typeGuard":"boolean isWorkflowConfigShape(Object config) { try { OBJECT_MAPPER.convertValue(config, WorkflowConfig.class); return true; } catch (Exception e) { return false; } }","tryCatchPattern":"try { studioAdapter.importDSL(data); } catch (IllegalArgumentException e) { if (\"Invalid config!\".equals(e.getMessage())) { // reproduce locally to see Jackson's real error\n    OBJECT_MAPPER.convertValue(data.get(\"config\"), WorkflowConfig.class); } throw e; }","preventionTips":["Validate config against WorkflowConfig yourself to get Jackson's detailed error message","Match node/edge field names and types exactly to WorkflowConfig (lists, not maps)","Keep Studio export version aligned with the admin runtime version","Diff hand-edited config against a fresh export"],"tags":["studio","json","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}