alibaba/spring-ai-alibaba · error · java.lang.UnsupportedOperationException
Unsupported type: ${type}
Error message
Unsupported type: ${type} What it means
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.
Source
Thrown at 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:309
public Map<String, Object> workflowToMap(Workflow workflow) {
throw new UnsupportedOperationException();
}
@Override
public ChatBot mapToChatBot(Map<String, Object> data) {
throw new UnsupportedOperationException();
}
@Override
public Map<String, Object> chatbotToMap(ChatBot chatBot) {
throw new UnsupportedOperationException();
}
@Override
public void validateDSLData(Map<String, Object> data) {
String type = MapReadUtil.getMapDeepValue(data, String.class, "type");
if (!"workflow".equalsIgnoreCase(type)) {
throw new UnsupportedOperationException("Unsupported type: " + type);
}
Map<?, ?> config = MapReadUtil.getMapDeepValue(data, Map.class, "config");
if (config == null) {
throw new IllegalArgumentException("config is null");
}
// 检查config是否为WorkflowConfig
try {
OBJECT_MAPPER.convertValue(config, WorkflowConfig.class);
}
catch (Exception e) {
throw new IllegalArgumentException("Invalid config!");
}
}
@Override
public Serializer getSerializer() {View on GitHub (pinned to f82da0b50f)
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
Example fix
// before
{"type": "chatbot", "config": {...}}
// after
{"type": "workflow", "config": {...}} Defensive patterns
Strategy: validation
Validate before calling
Object type = dslData.get("type");
if (!(type instanceof String t) || !"workflow".equalsIgnoreCase(t)) {
throw new UnsupportedOperationException("Studio DSL must be of type 'workflow'");
} Type guard
boolean isStudioWorkflowDsl(Map<String,Object> dsl) { return "workflow".equalsIgnoreCase(String.valueOf(dsl.get("type"))); } Try / catch
try { studioAdapter.importDSL(data); } catch (UnsupportedOperationException e) { log.error("Only Studio workflow-type DSL is supported: {}", e.getMessage()); throw e; } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
AI-assisted analysis of alibaba/spring-ai-alibaba@f82da0b50f (2026-09-09).
Data as JSON: /api/errors/679dc2a81a3b0fa5.
Report an issue: GitHub.