diff --git a/data-providers/file-data-provider/src/main/resources/file-data-provider.json b/data-providers/file-data-provider/src/main/resources/file-data-provider.json index 33a0530bc..2bbb8002b 100644 --- a/data-providers/file-data-provider/src/main/resources/file-data-provider.json +++ b/data-providers/file-data-provider/src/main/resources/file-data-provider.json @@ -25,6 +25,12 @@ "CSV" ] }, + { + "name": "path", + "required": true, + "defaultValue": "", + "type": "string" + }, { "name": "columns", "defaultValue": "", diff --git a/data-providers/http-data-provider/src/main/java/datart/data/provider/HttpDataProvider.java b/data-providers/http-data-provider/src/main/java/datart/data/provider/HttpDataProvider.java index 1e55b0a27..a24aa5e0d 100644 --- a/data-providers/http-data-provider/src/main/java/datart/data/provider/HttpDataProvider.java +++ b/data-providers/http-data-provider/src/main/java/datart/data/provider/HttpDataProvider.java @@ -142,13 +142,12 @@ private HttpRequestParam convert2RequestParam(Map schema) throws if (parser != null && StringUtils.isNotBlank(parser.toString())) { parserClass = parser.toString(); } - Class aClass = (Class) Class.forName(parserClass); - httpRequestParam.setResponseParser(aClass); - - httpRequestParam.setBody(schema.getOrDefault(BODY, "").toString()); - + Object body = schema.get(BODY); + if (body != null) { + httpRequestParam.setBody(body.toString()); + } httpRequestParam.setQueryParam((Map) schema.get(QUERY_PARAM)); httpRequestParam.setHeaders((Map) schema.get(HEADER));