{"record":{"id":"0b95bcb07f4219d0","repo":"apache/seatunnel","slug":"common-illegal-argument-0b95bc","errorCode":"COMMON_ILLEGAL_ARGUMENT","errorMessage":"Unsupported data format [%s], http connector only support json format now","messagePattern":"Unsupported data format \\[(.+?)\\], http connector only support json format now","errorType":"error_code","errorClass":"HttpConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-http/connector-http-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/http/source/HttpSource.java","lineNumber":187,"sourceCode":"                                                    \"partIndex\",\n                                                    BasicType.LONG_TYPE,\n                                                    0,\n                                                    false,\n                                                    null,\n                                                    null))\n                                    .build();\n                    this.catalogTable =\n                            CatalogTable.of(\n                                    TableIdentifier.of(\n                                            HttpConfig.CONNECTOR_IDENTITY, TablePath.DEFAULT),\n                                    binarySchema,\n                                    Collections.emptyMap(),\n                                    Collections.emptyList(),\n                                    null);\n                    break;\n                default:\n                    // TODO: use format SPI\n                    throw new HttpConnectorException(\n                            CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                            String.format(\n                                    \"Unsupported data format [%s], http connector only support json format now\",\n                                    format));\n            }\n        } else {\n            HttpConfig.ResponseFormat format = pluginConfig.get(HttpSourceOptions.FORMAT);\n            if (format == HttpConfig.ResponseFormat.BINARY) {\n                this.binaryMode = true;\n                this.binaryChunkSize = pluginConfig.get(HttpSourceOptions.BINARY_CHUNK_SIZE);\n                TableSchema binarySchema =\n                        TableSchema.builder()\n                                .column(\n                                        PhysicalColumn.of(\n                                                \"data\",\n                                                PrimitiveByteArrayType.INSTANCE,\n                                                0,\n                                                false,","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-http/connector-http-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/http/source/HttpSource.java#L169-L205","documentation":"HttpSource.buildSchemaWithConfig throws HttpConnectorException with CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT when the configured data_format is anything other than JSON, because the HTTP source currently only builds a schema from JSON responses. It fails at connector construction time, before reading starts.","triggerScenarios":"Setting plugin_output/data_format = \"text\", \"xml\", \"csv\", etc. for an HttpSource; thrown from the default branch of the format switch in the constructor path.","commonSituations":"Target API returns plain text, HTML, or XML and the user assumes the HTTP source parses it; copying configs from connectors that support more formats.","solutions":["Set data_format = \"json\" and ensure the endpoint returns JSON.","If the API returns non-JSON, put a proxy/transform layer in front that emits JSON, or use a custom source connector.","Check the supported format list in the HTTP source docs; the SPI for other formats is a TODO upstream."],"exampleFix":"// before\nsource {\n  Http {\n    data_format = \"text\"\n  }\n}\n// after\nsource {\n  Http {\n    data_format = \"json\"\n  }\n}","handlingStrategy":"validation","validationCode":"// Only allow json for HttpSource\nboolean ok = \"json\".equalsIgnoreCase(config.getString(\"data_format\"));","typeGuard":null,"tryCatchPattern":"try { createSource(config); } catch (HttpConnectorException e) { if (CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT.equals(e.getSeaTunnelErrorCode())) { /* fix data_format */ } }","preventionTips":["Always set data_format = \"json\" for HttpSource","Verify the endpoint actually returns JSON","For non-JSON APIs, wrap or transform upstream"],"tags":["http","source","format","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}