Skip to content

Fixes Map Based Parameter Checking for Generic Subclasses#689

Merged
velo merged 1 commit into
OpenFeign:masterfrom
kdavisk6:665-httpheaders-class-cast-exception
Apr 30, 2018
Merged

Fixes Map Based Parameter Checking for Generic Subclasses#689
velo merged 1 commit into
OpenFeign:masterfrom
kdavisk6:665-httpheaders-class-cast-exception

Conversation

@kdavisk6

@kdavisk6 kdavisk6 commented Apr 25, 2018

Copy link
Copy Markdown
Member

Fixes #655

When verifying that any of the @*Map annotations are in fact
Map instances, we were assuming that all values are direct
extension of a Map with generic type information intact. When
using frameworks like Spring, it is possible to have Map objects
that do not expose type information, like HttpHeaders, which
directly extend from a Map with the type information static.

This adds additional checking to the checkMapKeys function
to accomodate for Map subclasses without type information. If
the map key information cannot be validated, we simply pass it
through.

Fixes OpenFeign#665

When verifying that any of th `@*Map` annotations are in fact
`Map` instances, we were assumping that all values are direct
extension of a `Map` with generic type information intact.  When
using frameworks like Spring, it is possible to have `Map` objects
that do not expose type information, like `HttpHeaders`, which
directly extend from a `Map` with the type information static.

This added additional checking to the `checkMapKeys` function
to accomodate for `Map` subclasses without type information.  If
the map key information cannot be validated, we simply pass it
through.
@kdavisk6

Copy link
Copy Markdown
Member Author

@velo Is anyone available to review this?

@velo

velo commented Apr 30, 2018

Copy link
Copy Markdown
Member

I already did, but forgot to press the button. LGTM

@velo velo merged commit 7ce0727 into OpenFeign:master Apr 30, 2018
@kdavisk6 kdavisk6 deleted the 665-httpheaders-class-cast-exception branch July 20, 2018 14:55
@kerwin612

Copy link
Copy Markdown
Contributor

@kdavisk6 hi, I saw that you modified this bug, but it has not been released yet. How do our already released versions handle this bug?

@kdavisk6

Copy link
Copy Markdown
Member Author

This has been released. It is available in version 9.7 @ileler

@kerwin612

Copy link
Copy Markdown
Contributor

Thx,I am using spring-cloud-starter-openfeign[2.0.0.RELEASE], which depends on the feign-core[9.5.1].I can use it after switching to 9.7, thank you...

velo pushed a commit that referenced this pull request Oct 7, 2024
Fixes #665

When verifying that any of th `@*Map` annotations are in fact
`Map` instances, we were assumping that all values are direct
extension of a `Map` with generic type information intact.  When
using frameworks like Spring, it is possible to have `Map` objects
that do not expose type information, like `HttpHeaders`, which
directly extend from a `Map` with the type information static.

This added additional checking to the `checkMapKeys` function
to accomodate for `Map` subclasses without type information.  If
the map key information cannot be validated, we simply pass it
through.
velo pushed a commit that referenced this pull request Oct 8, 2024
Fixes #665

When verifying that any of th `@*Map` annotations are in fact
`Map` instances, we were assumping that all values are direct
extension of a `Map` with generic type information intact.  When
using frameworks like Spring, it is possible to have `Map` objects
that do not expose type information, like `HttpHeaders`, which
directly extend from a `Map` with the type information static.

This added additional checking to the `checkMapKeys` function
to accomodate for `Map` subclasses without type information.  If
the map key information cannot be validated, we simply pass it
through.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants