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

Feign interprets subclass of Requests.Options as POST payload #1420

Closed
dinhani opened this issue May 18, 2021 · 1 comment
Closed

Feign interprets subclass of Requests.Options as POST payload #1420

dinhani opened this issue May 18, 2021 · 1 comment
Labels
bug Unexpected or incorrect behavior

Comments

@dinhani
Copy link

dinhani commented May 18, 2021

I have a class that extends Request.Options so I can pass additional parameters to a custom Feign client.

class CustomOptions(
    val customOption: Int
) : Request.Options()

And in my Feign client I use it like this:

@FeignClient(...)
interface SomeClient {
    fun somePost(@RequestBody payload: SomePayload, customOptions: CustomOptions)
}

It works well with GET methods, but in POST methods, the subclassed option is identified as a duplicated payload because the following piece of code checks only for instances of Request.Options and the creation of the client fails with Method has too many Body parameters.

} else if (!isHttpAnnotation && parameterTypes[i] != Request.Options.class) {

I believe the previous check should also check for subclasses of Request.Options.

@dinhani dinhani changed the title Feign interprets Requests.Option as POST payload Feign interprets subclass of Requests.Options as POST payload May 18, 2021
@kdavisk6 kdavisk6 added the bug Unexpected or incorrect behavior label May 21, 2021
@dinhani
Copy link
Author

dinhani commented Dec 31, 2023

Fixed at #1620

@dinhani dinhani closed this as completed Dec 31, 2023
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

No branches or pull requests

2 participants