Support Conditional Parameter Expansion
See original GitHub issueHi!
We define our Spring MVC APIs with @RequestParam Optional<Type> something
.
It looks like Feign doesn’t handle it well and uses “toString()” version so that Spring fails to convert String -> Optional
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:18 (11 by maintainers)
Top Results From Across the Web
An introduction to parameter expansion in Bash
Conditional parameter expansion. Conditional parameter expansion allows branching on whether the parameter is unset, empty, or has content.
Read more >Shell Parameter Expansion (Bash Reference Manual) - GNU.org
The expansion is a string in the form of an assignment statement or declare command that, if evaluated, will recreate parameter with its...
Read more >How To Use Bash Parameter Substitution Like A Pro - nixCraft
Explains how to use Bash Parameter Substitution for string matriculation and expansion - includes tons of practical examples.
Read more >Bash Parameter Expansion - Linux Hint
Parameter expansion can be categorized by three groups. These are conditional parameter expansion, substring parameter expansion, and substitute parameter ...
Read more >10.2. Parameter Substitution
Same as $parameter, i.e., value of the variable parameter. In certain contexts, only the less ambiguous ${parameter} form works. May be used for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Has support to
Optional<T> @Param
been implemented in Feign?@yami12376
We are considering adding support for Level 2-4 uri template expression which will address most of what is discussed in this request. Specifically, we will adhere to the RFC rules regarding what to do when the value is
undefined
, which in our case is an explicitnull
. Empty Strings are not consideredundefined
, justempty
, which are still included.For example, using form style expressions
http://localhost:8132/test{?name}
, the result would be as follows:The only situation this will not handle is the case where a user may want to override this behavior for a single expression. Using the example above where the desired result is the variable on the query string without the
=
sign, we would need provide a facility to override the expansion logic. We may also consider extending the capability of theExpander
concept for this; however for Feign 11, we are going to focus primarily on the template levels.