OpenFeign / feign-annotation-error-decoder

Apache License 2.0
51 stars 9 forks source link

AnnotationErrorDecoder throws IllegalStateException on validateGeneratorCanBeUsedToGenerateExceptions with null body and complex body decoder #20

Closed SimY4 closed 5 years ago

SimY4 commented 5 years ago

Whenever you're trying to set up a complex body decoder (like SpringDecoder) the validation step passes null for response body which causes body decoder to throw NPE, which propagates as IllegalStateException. Setting the response body as Optional doesn't do anything because Optional type is not accounted for processing in feign.optionals.OptionalDecoder (Something about type parametricity details missing).

UPD: Injection of raw response entity doesn't work as well.