You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like the Content-Type header in a server response has been changed recently and is not supported by Java client
I'm getting now the following error when invoking Api.PaymentsApi.createPayment(CreatePaymentRequest). It used to work fine before.
Content type "application/hal+json,application/hal+json;charset=utf-8" is not supported for type: class Model.PtsV2PaymentsPost201Response
For a quick problem resolution, I made a small patch in my code using Javassist library
ClassPool classPool = ClassPool.getDefault();
CtClass ctClass = classPool.get("Invokers.ApiClient");
CtMethod ctMethod = ctClass.getDeclaredMethod("isJsonMime");
// This is a small change for the jsonMime regexp to accept "application/hal+json,application/hal+json;charset=utf-8"
// Content-Type response header. Actually, a server should return
// "application/hal+json;charset=utf-8" header value (no duplication). In this case, no fixes are needed.
ctMethod.setBody("{ " +
"String jsonMime = \"(?i)^(application/json|[^;/ \\t]+/[^;/ \\t]+[+]json)[ \\t]*(.*)?$\"; " +
"return $1 != null && ($1.matches(jsonMime) || $1.equalsIgnoreCase(\"application/json-patch+json\")); " +
"}");
ctClass.toClass();
Hello team,
Looks like the Content-Type header in a server response has been changed recently and is not supported by Java client
I'm getting now the following error when invoking
Api.PaymentsApi.createPayment(CreatePaymentRequest)
. It used to work fine before.Content type "application/hal+json,application/hal+json;charset=utf-8" is not supported for type: class Model.PtsV2PaymentsPost201Response
Please see
https://github.com/CyberSource/cybersource-rest-client-java/blob/master/src/main/java/Invokers/ApiClient.java#L1064
https://github.com/CyberSource/cybersource-rest-client-java/blob/master/src/main/java/Invokers/ApiClient.java#L953
Tried versions 0.0.58 and 0.0.60
Thanks
The text was updated successfully, but these errors were encountered: