Closed lmoesle closed 7 months ago
I found out that there is another Camunda Community Rest Api implementation (https://github.com/camunda-community-hub/camunda-platform-7-rest-client-spring-boot). We swapped the dependency in our application which fixed the error
I had same issue and fix it by sub classing ApiClient
`@Component @Primary public class Utf8CamundaApiClient extends ApiClient {
@Override
public <T> T invokeAPI(String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams,
String urlQueryDeepObject, Object body, Map<String, String> headerParams, Map<String, String> cookieParams,
Map<String, Object> formParams, String accept, String contentType, String[] authNames,
TypeReference<T> returnType) throws ApiException {
if ("application/json".equals(contentType)) {
contentType = "application/json;charset=utf-8";
}
return super.invokeAPI(path, method, queryParams, collectionQueryParams, urlQueryDeepObject, body, headerParams,
cookieParams, formParams, accept, contentType, authNames, returnType);
}
@PostConstruct
public void initMe() {
Configuration.setDefaultApiClient(this);
}
}`
@holgerhagen is this what we discussed - fixed by https://github.com/camunda-community-hub/camunda-platform-7-rest-client-java/pull/109?
@berndruecker yes, the update of the openapi-generator should fix this issue as well.
Message Correlation fails with an ApiException if the CorrelationMessageDto Object contains any special Characters (Umlaute like ä, ö, ü, ß, ...).
I did do some debugging and the api client seems to use the wrong charset (ISO_8859_1 instead of UTF-8). The error occurs in the generated
ApiClient
when the Content-Type isapplication/json
and the charsetnull
. The default charset is used for the request which somehow is ISO_8859_1. This causes the serializer to serialize the object to invalid json.The error started occuring after migrating our application to spring boot 3.1.5 and upgrading the
camunda-engine-rest-client-openapi-java
to 7.20.2.FYI these are the logs of our application:
This is a snippet of our code calling
camunda-engine-rest-client-openapi-java
Lib: