Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow decoding of parameterizedTypes (generics) Fixes #759 #758

Merged
merged 2 commits into from
Aug 12, 2018

Conversation

RicardoRdzG
Copy link
Contributor

If type is a parameterizedType then extract rawType before proceeding with decoding instead of Trowing an exception

@@ -69,6 +70,10 @@ public Object decode(Response response, Type type) throws IOException {
return Util.emptyValueOf(type);
if (response.body() == null)
return null;
while (type instanceof ParameterizedType) {
ParameterizedType ptype = (ParameterizedType) type;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a test covering this loop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test added

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, thanks! I will review it right now

@RicardoRdzG
Copy link
Contributor Author

@velo Added a test and reformatted using eclipse formatter

@RicardoRdzG RicardoRdzG changed the title Allow decoding of parameterizedTypes (generics) Allow decoding of parameterizedTypes (generics) Fixes #759 Aug 9, 2018
Copy link
Member

@velo velo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good, minor code format...

.hasBody(
"<?xml version=\"1.0\" encoding=\"UTF-8\" "
+
"standalone=\"yes\"?><mockObject xsi:noNamespaceSchemaLocation=\"http://apihost/schema.xsd\" "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add the + sign in front of the string?

                + "standalone=\"yes\"?><mockObject xsi:noNamespaceSchemaLocation=\"http://apihost/schema.xsd\" "
                + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"
                + "<value>Test</value></mockObject>"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the eclipse formatter on the file before uploading. Can that change be added to the formatting file?

@RicardoRdzG RicardoRdzG force-pushed the JAXB-Generic-decoding branch 2 times, most recently from 73a095b to 444c298 Compare August 10, 2018 00:37
@kdavisk6
Copy link
Member

@velo something is off with the Travis build for this PR. It succeeded for JDK8 but not for JDK11. Can you take a look?

@kdavisk6 kdavisk6 added this to the 10.0.0 milestone Aug 10, 2018
@RicardoRdzG
Copy link
Contributor Author

build failure seems like a fluke, sent a small amend to kick the build

@kdavisk6 kdavisk6 added the bug Unexpected or incorrect behavior label Aug 12, 2018
@kdavisk6 kdavisk6 merged commit e4743d4 into OpenFeign:master Aug 12, 2018
velo pushed a commit that referenced this pull request Oct 7, 2024
* Allow decoding of parameterizedTypes (generics)

* Allow decoding of parameterizedTypes (generics)
velo pushed a commit that referenced this pull request Oct 8, 2024
* Allow decoding of parameterizedTypes (generics)

* Allow decoding of parameterizedTypes (generics)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants