[BUG] Java Feign Client produces ClassCastException for methods returning Object
Created by: lbilger
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? -
Have you searched for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When I have an operation that returns Object
, the ApiResponseDecoder
will throw a ClassCastException
because it tries to cast a Class
to ParameterizedType
.
openapi-generator version
5.4.0
OpenAPI declaration file content or url
see the reproducer linked below.
Generation Details
<generatorName>java</generatorName>
<library>feign</library>
<feignVersion>11.x</feignVersion>
Steps to reproduce
I have created a minimal reproducer in this GitHub repository. The maven build mvn clean test
will report a test failure with feign.codec.DecodeException: class java.lang.Class cannot be cast to class java.lang.reflect.ParameterizedType
.
Related issues/PRs
I will create a PR soon.
Suggest a fix
I will create a PR soon.