use of io.servicecomb.common.rest.codec.LocalRestServerRequest in project java-chassis by ServiceComb.
the class CseClientHttpRequest method collectArguments.
private Object[] collectArguments(RequestMeta requestMeta, Map<String, List<String>> queryParams) {
RestServerRequest mockRequest = new LocalRestServerRequest(requestMeta.getPathParams(), queryParams, httpHeaders, requestBody);
List<RestParam> paramList = requestMeta.getSwaggerRestOperation().getParamList();
Object[] args = new Object[paramList.size()];
for (int idx = 0; idx < paramList.size(); idx++) {
RestParam param = paramList.get(idx);
try {
args[idx] = param.getParamProcessor().getValue(mockRequest);
} catch (Exception e) {
LOGGER.error("error arguments for operation " + requestMeta.getOperationMeta().getMicroserviceQualifiedName(), e);
throw new Error(e);
}
}
return args;
}
Aggregations