{"record":{"id":"679dc2a81a3b0fa5","repo":"alibaba/spring-ai-alibaba","slug":"unsupported-type-type","errorCode":null,"errorMessage":"Unsupported type: ${type}","messagePattern":"Unsupported type: (.+?)","errorType":"validation","errorClass":"java.lang.UnsupportedOperationException","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":309,"sourceCode":"\tpublic Map<String, Object> workflowToMap(Workflow workflow) {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t@Override\n\tpublic ChatBot mapToChatBot(Map<String, Object> data) {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t@Override\n\tpublic Map<String, Object> chatbotToMap(ChatBot chatBot) {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\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() {","sourceCodeStart":291,"sourceCodeEnd":327,"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#L291-L327","documentation":"Thrown by StudioDSLAdapter.validateDSLData as UnsupportedOperationException when the deep-read 'type' value of the Studio DSL is not 'workflow' (case-insensitive). Only workflow-type Studio exports are supported by this adapter; chatbot or other Studio app types are rejected outright.","triggerScenarios":"Importing a Studio DSL whose type field is 'chatbot', missing, or misspelled; MapReadUtil.getMapDeepValue returns null when 'type' is absent, also failing the equalsIgnoreCase check; passing a Dify or native agent DSL to the Studio adapter.","commonSituations":"Exporting a non-workflow app from Studio and trying to import it via the workflow adapter; hand-editing the type field; using the wrong adapter for the document format.","solutions":["Set the DSL's 'type' field to 'workflow' (any casing) or export a workflow-type app from Studio","Confirm you are using StudioDSLAdapter only for Studio workflow exports","Verify the 'type' key exists at the expected path in the document (deep lookup may miss renamed/nested keys)","If you need to import a chatbot app, use the adapter matching that format"],"exampleFix":"// before\n{\"type\": \"chatbot\", \"config\": {...}}\n\n// after\n{\"type\": \"workflow\", \"config\": {...}}","handlingStrategy":"validation","validationCode":"Object type = dslData.get(\"type\");\nif (!(type instanceof String t) || !\"workflow\".equalsIgnoreCase(t)) {\n    throw new UnsupportedOperationException(\"Studio DSL must be of type 'workflow'\");\n}","typeGuard":"boolean isStudioWorkflowDsl(Map<String,Object> dsl) { return \"workflow\".equalsIgnoreCase(String.valueOf(dsl.get(\"type\"))); }","tryCatchPattern":"try { studioAdapter.importDSL(data); } catch (UnsupportedOperationException e) { log.error(\"Only Studio workflow-type DSL is supported: {}\", e.getMessage()); throw e; }","preventionTips":["Export workflow-type apps from Studio when using StudioDSLAdapter","Check the 'type' field before choosing an adapter","Don't reuse the Studio adapter for Dify or native agent DSLs"],"tags":["studio","unsupported-value","validation"],"backgroundTag":"invalid-enum-value","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"}