use of io.micronaut.http.client.interceptor.configuration.ClientVersioningConfiguration in project micronaut-core by micronaut-projects.
the class VersionClientRequestBinder method bind.
@Override
public void bind(@NonNull MethodInvocationContext<Object, Object> context, @NonNull ClientRequestUriContext uriContext, @NonNull MutableHttpRequest<?> request) {
context.findAnnotation(Version.class).flatMap(AnnotationValue::stringValue).filter(StringUtils::isNotEmpty).ifPresent(version -> {
ClientVersioningConfiguration configuration = getVersioningConfiguration(context.getAnnotationMetadata());
configuration.getHeaders().forEach(header -> request.header(header, version));
configuration.getParameters().forEach(parameter -> uriContext.addQueryParameter(parameter, version));
});
}
Aggregations