-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
feedback providedFeedback has been provided to the authorFeedback has been provided to the authorspring-cloudIssues related to Spring Cloud OpenFeignIssues related to Spring Cloud OpenFeign
Description
We wanted to add headers, which are meant to transport an URI.
The RequestTemplateFactoryResolver
(or the ReflectiveFeign
class before) throws an exception if an optional (required=false
in the annotation/OpenAPI + nullable=true
in the OpenAPI) header was not set and if the header is from type URI
.
The reason is the metaData.urlIndex
, which was created in the Contract.parseAndValidateMetadata()
method:
// Line 137
if (parameterTypes[i] == URI.class) {
data.urlIndex(i);
The generated client class for Feign looks like this:
@PostMapping(
value = "/dummy/test",
produces = {"application/json"},
consumes = {"application/json"})
DummyResponseModel createDummyExample(
@RequestHeader(value = "FIRST_MANDATORY", required = true) String first,
@RequestHeader(value = "SECO_MANDATORY", required = true) String second,
@RequestHeader(value = "THIRD_MANDATORY", required = true) String third,
@Valid @RequestBody MyBodyModel bodyModel,
@RequestHeader(value = "OPT_FIRST", required = false) String optFirst,
@RequestHeader(value = "OPT_SEC", required = false) URI optSec,
@RequestHeader(value = "OPT_THIRD", required = false) URI optThird);
Metadata
Metadata
Assignees
Labels
feedback providedFeedback has been provided to the authorFeedback has been provided to the authorspring-cloudIssues related to Spring Cloud OpenFeignIssues related to Spring Cloud OpenFeign