-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
Hello,
I'm using a feign client that looks something like this:
@FeignClient("api", url = "\${api-url}", decode404 = true)
interface Client {
@GetMapping("/api/article/{id}")
fun getLatestRevision(
@PathVariable("id") id: String,
): Optional<ArticleRevision>
@GetMapping("/api/video/{id}/revision/{revision}")
fun getRevision(
@PathVariable("id") id: String,
@PathVariable("revision") revision: Int
): ArticleRevision
}The assumption that I'm making is that when the first method gets a 404 response, it should return Optional.empty, which it does. But since the return type of the second method is not nullable, I would assume that an exception would be thrown if the response is 404. However, this does not happen and the function just returns null. Is this expected behavior? Can I not use decode404 and expect a non-nullable return value to not be null?
Metadata
Metadata
Assignees
Labels
No labels