Skip to content

Support additional URI Template Levels #1019

Open
@ddoubleday

Description

@ddoubleday

In versions of Feign before 10.x, if the URI template looked like http://base/action/{arg1}/{arg2}, and null was passed as the value to arg1, the URI

http://base/action/{arg1}/somevalue

would be tried, and rejected with IllegalArgumentException. That probably wasn't the right thing to do, but NOW, the null is actually resolved, and the situation is actually worse, resulting in the URI

http://base/action//someValue

resulting in, if you are using Spring Boot 2, a "not normalized URI exception" because they are doing security scans on URIs and disallowing consecutive slashes.

Even worse, if a value is passed to arg1 and null is passed to arg 2 and it is resolved, it can map to the entirely wrong controller method as:

http://base/action/someValue/

if these are GET operations, that might get the entire list associated with someValue, instead of the intended one value "someValue2".

Shouldn't feign refuse to resolve PATH variables if the supplied argument is null, and just throw some kind of NotNullable exception?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFor recommending new capabilitiesfeign-12Issues that are related to the next major release

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions