Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
f0dbdc9
Fixing compile errors for new Boot and Spring Framework versions
ryanjbaxter Aug 7, 2024
b715d5e
Bumping versions
spring-builds Aug 7, 2024
f232205
Update SNAPSHOT to 4.2.0-M1
spring-builds Aug 19, 2024
72e74b2
Going back to snapshots
spring-builds Aug 19, 2024
88b05dd
Bumping versions
spring-builds Aug 24, 2024
3b753ba
Bump com.google.protobuf:protobuf-java from 3.25.3 to 3.25.4 (#1045)
dependabot[bot] Sep 4, 2024
56e779d
Bump com.fasterxml.jackson.dataformat:jackson-dataformat-smile (#1042)
dependabot[bot] Sep 4, 2024
fc1093e
Update GitHub actions.
OlgaMaciaszek Sep 4, 2024
16229ce
Merge remote-tracking branch 'origin/main'
OlgaMaciaszek Sep 4, 2024
e0c3f7e
Update dependabot.
OlgaMaciaszek Sep 4, 2024
220faec
Merge remote-tracking branch 'origin/4.1.x'
OlgaMaciaszek Sep 4, 2024
cea0947
Add dependabot checks for npm.
OlgaMaciaszek Sep 4, 2024
b5c78b1
Bumping versions
spring-builds Sep 5, 2024
73af460
Merge remote-tracking branch 'origin/4.1.x'
OlgaMaciaszek Sep 5, 2024
6be8546
Bump @antora/collector-extension in /docs (#1057)
dependabot[bot] Sep 6, 2024
3dd1819
Bump @springio/asciidoctor-extensions in /docs (#1060)
dependabot[bot] Sep 6, 2024
fad2640
Bump antora from 3.2.0-alpha.4 to 3.2.0-alpha.6 in /docs (#1063)
dependabot[bot] Sep 6, 2024
076dd29
Merge remote-tracking branch 'origin/main'
OlgaMaciaszek Sep 6, 2024
a11a442
Merge remote-tracking branch 'origin/4.1.x'
OlgaMaciaszek Sep 6, 2024
d3ecd5c
Merge remote-tracking branch 'origin/4.1.x'
OlgaMaciaszek Sep 6, 2024
fec17ae
Adds ignorecase field to pageable spring (#1047)
gklp Sep 12, 2024
ee9f34f
Make Content-Encoding configurable (#1071)
AndreTeigler Sep 25, 2024
79b81dd
Bump commons-io:commons-io from 2.16.1 to 2.17.0 (#1091)
dependabot[bot] Sep 25, 2024
eca3b0b
Merge remote-tracking branch 'origin/4.1.x'
OlgaMaciaszek Sep 25, 2024
61c86e4
Bump com.google.protobuf:protobuf-java from 3.25.4 to 3.25.5 (#1090)
dependabot[bot] Sep 25, 2024
270934d
Bump com.google.protobuf:protobuf-java in /spring-cloud-openfeign-cor…
dependabot[bot] Sep 25, 2024
a6f8202
Bump io.github.openfeign:feign-bom from 13.3 to 13.4 (#1073)
dependabot[bot] Sep 25, 2024
1c00226
polishing FeignClientsRegistrar (#1038)
birariro Sep 26, 2024
964d3c8
Merge remote-tracking branch 'origin/4.1.x'
OlgaMaciaszek Sep 27, 2024
fc4c9f8
Bump com.fasterxml.jackson.dataformat:jackson-dataformat-smile (#1097)
dependabot[bot] Oct 2, 2024
442b1c9
Merge remote-tracking branch 'origin/4.1.x'
OlgaMaciaszek Oct 2, 2024
2295955
Update SNAPSHOT to 4.2.0-M2
spring-builds Oct 8, 2024
b56dc8d
Going back to snapshots
spring-builds Oct 8, 2024
f9e55b5
fix: remove last slash of url
birariro Jun 21, 2024
8cc00f0
code rollback
birariro Sep 28, 2024
560239a
Delete '/' at the end of url
artem-gorshkov Apr 28, 2022
0f55e2d
Allow removing trailing slashes (#1100)
OlgaMaciaszek Oct 10, 2024
4575b41
Bump io.github.openfeign:feign-bom from 13.4 to 13.5 (#1099)
dependabot[bot] Oct 11, 2024
1770f0b
Merge remote-tracking branch 'origin/main'
OlgaMaciaszek Oct 11, 2024
ffd0c37
Update deprecations.
OlgaMaciaszek Oct 11, 2024
959db4a
Bump io.vavr:vavr from 0.10.4 to 0.10.5 (#1109)
dependabot[bot] Oct 15, 2024
e1d6ecd
Bump @antora/collector-extension in /docs (#1106)
dependabot[bot] Oct 15, 2024
de1c351
Merge remote-tracking branch 'origin/4.1.x'
OlgaMaciaszek Oct 17, 2024
80cba56
Merge remote-tracking branch 'origin/main'
OlgaMaciaszek Oct 17, 2024
9c0d439
Merge remote-tracking branch 'origin/4.1.x'
OlgaMaciaszek Oct 31, 2024
9afa68b
Make feign-form-spring optional.
OlgaMaciaszek Oct 31, 2024
4367c96
Reformat.
OlgaMaciaszek Oct 31, 2024
0194a99
Bump com.fasterxml.jackson.dataformat:jackson-dataformat-smile (#1115)
dependabot[bot] Oct 31, 2024
a5db369
Revert make feign-form optional
spencergibb Nov 5, 2024
766f31c
Ignores duplicate resource from boot.
spencergibb Nov 7, 2024
dfb7ab6
Update SNAPSHOT to 4.2.0-RC1
spring-builds Nov 8, 2024
721fdef
Going back to snapshots
spring-builds Nov 8, 2024
0f40833
Merge remote-tracking branch 'origin/4.1.x'
OlgaMaciaszek Nov 12, 2024
ad615b7
Bump @antora/collector-extension in /docs (#1123)
dependabot[bot] Nov 19, 2024
7acb03a
Fix Code of Conduct link.
OlgaMaciaszek Nov 19, 2024
15ecd4d
Bumping versions
spring-builds Nov 20, 2024
7a2a681
Bump commons-io:commons-io from 2.17.0 to 2.18.0 (#1127)
dependabot[bot] Nov 25, 2024
611edf5
Bump com.fasterxml.jackson.dataformat:jackson-dataformat-smile (#1133)
dependabot[bot] Nov 29, 2024
d675b68
Bump @antora/collector-extension in /docs (#1130)
dependabot[bot] Nov 29, 2024
5958f70
Disable docs dependencies for 2024.0.0 release
ryanjbaxter Dec 2, 2024
9ed2ab2
Update SNAPSHOT to 4.2.0
spring-builds Dec 3, 2024
a8ee17e
Going back to snapshots
spring-builds Dec 3, 2024
761bb50
Bumping versions to 4.2.1-SNAPSHOT after release
spring-builds Dec 3, 2024
29f79e9
Bumping dependency versions after release
spring-builds Dec 3, 2024
1c2cd08
Bumping versions
spring-builds Dec 3, 2024
dfdd900
Bumping versions
spring-builds Dec 4, 2024
d170ae5
Bump antora from 3.2.0-alpha.6 to 3.2.0-alpha.8 in /docs (#1139)
dependabot[bot] Dec 16, 2024
3bf0d84
Bump @antora/collector-extension from 1.0.0-rc.1 to 1.0.1 in /docs (#…
dependabot[bot] Dec 17, 2024
6850706
Merge branch '4.1.x'
ryanjbaxter Dec 17, 2024
44d7d6b
Merge branch '4.1.x'
ryanjbaxter Dec 17, 2024
66d590c
Document disabling protocol upgrade for Apache HC5. Fixes gh-1141.
OlgaMaciaszek Jan 9, 2025
4f94fff
Merge remote-tracking branch 'origin/4.1.x'
OlgaMaciaszek Jan 16, 2025
78262f1
Upgrade versions to 4.3.0-SNAPSHOT.
OlgaMaciaszek Jan 16, 2025
8202c0b
Bumping versions
spring-builds Jan 16, 2025
90ac9ab
Bumping versions
spring-builds Jan 24, 2025
ad19228
Bumping versions
spring-builds Jan 25, 2025
ee1bbd9
Update SNAPSHOT to 4.3.0-M1
spring-builds Jan 30, 2025
5095ef4
Going back to snapshots
spring-builds Jan 30, 2025
b5ca153
Merge remote-tracking branch 'origin/4.1.x' into 4.2.x
OlgaMaciaszek Feb 10, 2025
a3befcc
Merge remote-tracking branch 'origin/4.2.x'
OlgaMaciaszek Feb 10, 2025
596b2be
Update dependabot settings.
OlgaMaciaszek Feb 10, 2025
99239f6
Merge remote-tracking branch 'origin/4.1.x' into 4.2.x
OlgaMaciaszek Feb 10, 2025
0d30431
Merge remote-tracking branch 'origin/4.2.x'
OlgaMaciaszek Feb 10, 2025
6153105
docs: docs: Add references to Feign QueryMapEncoder and FeignClientsC…
bombo-dev Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ given the ability to merge pull requests.

## Code of Conduct
This project adheres to the Contributor Covenant [code of
conduct](https://github.com/spring-cloud/spring-cloud-build/blob/main/docs/src/main/asciidoc/code-of-conduct.adoc). By participating, you are expected to uphold this code. Please report
conduct](https://github.com/spring-cloud/spring-cloud-build/blob/main/docs/modules/ROOT/partials/code-of-conduct.adoc). By participating, you are expected to uphold this code. Please report
unacceptable behavior to [email protected].

## Code Conventions and Housekeeping
Expand Down
29 changes: 9 additions & 20 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@ version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "3.1.x" # oldest OSS supported branch
target-branch: "4.1.x" # oldest OSS supported branch
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "4.0.x" # oldest OSS supported branch
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "4.1.x"
target-branch: "4.2.x"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
Expand All @@ -24,18 +19,7 @@ updates:
directory: /
schedule:
interval: daily
target-branch: 3.1.x
ignore:
# only upgrade patch versions for maintenance branch
- dependency-name: "*"
update-types:
- version-update:semver-major
- version-update:semver-minor
- package-ecosystem: maven
directory: /
schedule:
interval: daily
target-branch: 4.0.x
target-branch: 4.1.x
ignore:
# only upgrade patch versions for maintenance branch
- dependency-name: "*"
Expand All @@ -46,7 +30,7 @@ updates:
directory: /
schedule:
interval: daily
target-branch: 4.1.x
target-branch: 4.2.x
ignore:
# only upgrade patch versions for maintenance branch
- dependency-name: "*"
Expand Down Expand Up @@ -78,3 +62,8 @@ updates:
directory: /docs
schedule:
interval: weekly
- package-ecosystem: npm
target-branch: 4.2.x
directory: /docs
schedule:
interval: weekly
27 changes: 25 additions & 2 deletions docs/modules/ROOT/pages/spring-cloud-openfeign.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,25 @@ When it comes to the Apache HttpClient 5-backed Feign clients, it's enough to en
You can customize the HTTP client used by providing a bean of either `org.apache.hc.client5.http.impl.classic.CloseableHttpClient` when using Apache HC5.

You can further customise http clients by setting values in the `spring.cloud.openfeign.httpclient.xxx` properties. The ones prefixed just with `httpclient` will work for all the clients, the ones prefixed with `httpclient.hc5` to Apache HttpClient 5, the ones prefixed with `httpclient.okhttp` to OkHttpClient and the ones prefixed with `httpclient.http2` to Http2Client. You can find a full list of properties you can customise in the appendix.
If you can not configure Apache HttpClient 5 by using properties, there is an `HttpClientBuilderCustomizer` interface for programmatic configuration.
If you can not configure Apache HttpClient 5 by using properties, there is an `HttpClient5FeignConfiguration.HttpClientBuilderCustomizer` interface for programmatic configuration.

TIP: Apache HTTP Components `5.4` have changed defaults in the HttpClient relating to HTTP/1.1 TLS upgrades. Most proxy servers handle upgrades without issue, however, you may encounter issues with Envoy or Istio. If you need to restore previous behaviour, you can use `HttpClient5FeignConfiguration.HttpClientBuilderCustomizer` to do it, as shown in the example below.

[source,java,indent=0]
----
@Configuration
public class FooConfiguration {

@Bean
public HttpClient5FeignConfiguration.HttpClientBuilderCustomizer httpClientBuilder() {
return (httpClientBuilder) -> {
RequestConfig.Builder requestConfigBuilder = RequestConfig.custom();
requestConfigBuilder.setProtocolUpgradeEnabled(false);
httpClientBuilder.setDefaultRequestConfig(requestConfigBuilder.build());
};
}
}
----

TIP: Starting with Spring Cloud OpenFeign 4, the Feign Apache HttpClient 4 is no longer supported. We suggest using Apache HttpClient 5 instead.

Expand Down Expand Up @@ -288,7 +306,12 @@ public class CustomConfiguration {
}
----

TIP: By default, Feign clients do not encode slash `/` characters. You can change this behaviour, by setting the value of `spring.cloud.openfeign.client.decodeSlash` to `false`.
TIP: By default, Feign clients do not encode slash `/` characters. You can change this behaviour, by setting the value of `spring.cloud.openfeign.client.decode-slash` to `false`.


TIP: By default, Feign clients do not remove trailing slash `/` characters from the request path.
You can change this behaviour, by setting the value of `spring.cloud.openfeign.client.remove-trailing-slash` to `true`.
Trailing slash removal from the request path is going to be made the default behaviour in the next major release.

[[springencoder-configuration]]
==== `SpringEncoder` configuration
Expand Down
18 changes: 10 additions & 8 deletions docs/modules/ROOT/partials/_configprops.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
|===
|Name | Default | Description

|spring.cloud.compatibility-verifier.compatible-boot-versions | | Default accepted versions for the Spring Boot dependency. You can set {@code x} for the patch version if you don't want to specify a concrete value. Example: {@code 3.4.x}
|spring.cloud.compatibility-verifier.compatible-boot-versions | `+++3.5.x+++` | Default accepted versions for the Spring Boot dependency. You can set {@code x} for the patch version if you don't want to specify a concrete value. Example: {@code 3.5.x}
|spring.cloud.compatibility-verifier.enabled | `+++false+++` | Enables creation of Spring Cloud compatibility verification.
|spring.cloud.config.allow-override | `+++true+++` | Flag to indicate that {@link #isOverrideSystemProperties() systemPropertiesOverride} can be used. Set to false to prevent users from changing the default accidentally. Default true.
|spring.cloud.config.initialize-on-context-refresh | `+++false+++` | Flag to initialize bootstrap configuration on context refresh event. Default false.
Expand Down Expand Up @@ -58,6 +58,7 @@
|spring.cloud.loadbalancer.retry.retry-on-all-operations | `+++false+++` | Indicates retries should be attempted on operations other than `HttpMethod.GET`.
|spring.cloud.loadbalancer.retry.retryable-exceptions | `+++{}+++` | A `Set` of `Throwable` classes that should trigger a retry.
|spring.cloud.loadbalancer.retry.retryable-status-codes | `+++{}+++` | A `Set` of status codes that should trigger a retry.
|spring.cloud.loadbalancer.stats.include-path | `+++true+++` | Indicates whether the {@code path} should be added to {@code uri} tag in metrics. When {@link RestTemplate} is used to execute load-balanced requests with high cardinality paths, setting it to {@code false} is recommended.
|spring.cloud.loadbalancer.stats.micrometer.enabled | `+++false+++` | Enables micrometer metrics for load-balanced requests.
|spring.cloud.loadbalancer.sticky-session.add-service-instance-cookie | `+++false+++` | Indicates whether a cookie with the newly selected instance should be added by LoadBalancer.
|spring.cloud.loadbalancer.sticky-session.instance-id-cookie-name | `+++sc-lb-instance-id+++` | The name of the cookie holding the preferred instance id.
Expand All @@ -73,6 +74,7 @@
|spring.cloud.openfeign.client.default-config | `+++default+++` |
|spring.cloud.openfeign.client.default-to-properties | `+++true+++` |
|spring.cloud.openfeign.client.refresh-enabled | `+++false+++` | Enables options value refresh capability for Feign.
|spring.cloud.openfeign.client.remove-trailing-slash | `+++false+++` | If {@code true}, trailing slashes at the end of request urls will be removed.
|spring.cloud.openfeign.compression.request.content-encoding-types | | The list of content encodings (applicable encodings depend on the used client).
|spring.cloud.openfeign.compression.request.enabled | `+++false+++` | Enables the request sent by Feign to be compressed.
|spring.cloud.openfeign.compression.request.mime-types | `+++[text/xml, application/xml, application/json]+++` | The list of supported mime types.
Expand All @@ -85,28 +87,28 @@
|spring.cloud.openfeign.httpclient.disable-ssl-validation | `+++false+++` |
|spring.cloud.openfeign.httpclient.follow-redirects | `+++true+++` |
|spring.cloud.openfeign.httpclient.hc5.connection-request-timeout | `+++3+++` | Default value for connection request timeout.
|spring.cloud.openfeign.httpclient.hc5.connection-request-timeout-unit | | Default value for connection request timeout unit.
|spring.cloud.openfeign.httpclient.hc5.connection-request-timeout-unit | `+++minutes+++` | Default value for connection request timeout unit.
|spring.cloud.openfeign.httpclient.hc5.enabled | `+++true+++` | Enables the use of the Apache HTTP Client 5 by Feign.
|spring.cloud.openfeign.httpclient.hc5.pool-concurrency-policy | | Pool concurrency policies.
|spring.cloud.openfeign.httpclient.hc5.pool-reuse-policy | | Pool connection re-use policies.
|spring.cloud.openfeign.httpclient.hc5.pool-concurrency-policy | `+++strict+++` | Pool concurrency policies.
|spring.cloud.openfeign.httpclient.hc5.pool-reuse-policy | `+++fifo+++` | Pool connection re-use policies.
|spring.cloud.openfeign.httpclient.hc5.socket-timeout | `+++5+++` | Default value for socket timeout.
|spring.cloud.openfeign.httpclient.hc5.socket-timeout-unit | | Default value for socket timeout unit.
|spring.cloud.openfeign.httpclient.hc5.socket-timeout-unit | `+++seconds+++` | Default value for socket timeout unit.
|spring.cloud.openfeign.httpclient.http2.version | `+++HTTP_2+++` | Configure the protocols used by this client to communicate with remote servers. Uses {@link String} value of {@link HttpClient.Version}.
|spring.cloud.openfeign.httpclient.max-connections | `+++200+++` |
|spring.cloud.openfeign.httpclient.max-connections-per-route | `+++50+++` |
|spring.cloud.openfeign.httpclient.ok-http.protocols | | Configure the protocols used by this client to communicate with remote servers. Uses {@link String} values of {@link Protocol}.
|spring.cloud.openfeign.httpclient.ok-http.read-timeout | `+++60s+++` | {@link OkHttpClient} read timeout; defaults to 60 seconds.
|spring.cloud.openfeign.httpclient.time-to-live | `+++900+++` |
|spring.cloud.openfeign.httpclient.time-to-live-unit | |
|spring.cloud.openfeign.httpclient.time-to-live-unit | `+++seconds+++` |
|spring.cloud.openfeign.lazy-attributes-resolution | `+++false+++` | Switches @FeignClient attributes resolution mode to lazy.
|spring.cloud.openfeign.micrometer.enabled | `+++true+++` | Enables Micrometer capabilities for Feign.
|spring.cloud.openfeign.oauth2.clientRegistrationId | | Provides a clientId to be used with OAuth2.
|spring.cloud.openfeign.oauth2.enabled | `+++false+++` | Enables feign interceptor for managing oauth2 access token.
|spring.cloud.openfeign.okhttp.enabled | `+++false+++` | Enables the use of the OK HTTP Client by Feign.
|spring.cloud.refresh.additional-property-sources-to-retain | | Additional property sources to retain during a refresh. Typically only system property sources are retained. This property allows property sources, such as property sources created by EnvironmentPostProcessors to be retained as well.
|spring.cloud.refresh.enabled | `+++true+++` | Enables autoconfiguration for the refresh scope and associated features.
|spring.cloud.refresh.extra-refreshable | `+++true+++` | Additional class names for beans to post process into refresh scope.
|spring.cloud.refresh.never-refreshable | `+++true+++` | Comma separated list of class names for beans to never be refreshed or rebound.
|spring.cloud.refresh.extra-refreshable | `+++true+++` | Additional bean names or class names for beans to post process into refresh scope.
|spring.cloud.refresh.never-refreshable | `+++true+++` | Comma separated list of bean names or class names for beans to never be refreshed or rebound.
|spring.cloud.refresh.on-restart.enabled | `+++true+++` | Enable refreshing context on start.
|spring.cloud.service-registry.auto-registration.enabled | `+++true+++` | Whether service auto-registration is enabled. Defaults to true.
|spring.cloud.service-registry.auto-registration.fail-fast | `+++false+++` | Whether startup fails if there is no AutoServiceRegistration. Defaults to false.
Expand Down
2 changes: 1 addition & 1 deletion docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign</artifactId>
<version>4.1.5-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<scm>
Expand Down
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-openfeign</artifactId>
<version>4.1.5-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Spring Cloud OpenFeign</name>
<description>Spring Cloud OpenFeign</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>4.1.6-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath/>
</parent>
<scm>
Expand All @@ -25,8 +25,8 @@
</scm>
<properties>
<main.basedir>${basedir}</main.basedir>
<jackson.version>2.17.3</jackson.version>
<spring-cloud-commons.version>4.1.6-SNAPSHOT</spring-cloud-commons.version>
<jackson.version>2.18.2</jackson.version>
<spring-cloud-commons.version>4.3.0-SNAPSHOT</spring-cloud-commons.version>

<!-- Plugin versions -->
<maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
Expand Down Expand Up @@ -78,6 +78,7 @@
<configuration>
<ignoredResourcePatterns>
<ignoredResourcePattern>mozilla/public-suffix-list.txt</ignoredResourcePattern>
<ignoredResourcePattern>mockito-extensions/org.mockito.plugins.MockResolver</ignoredResourcePattern>
</ignoredResourcePatterns>
</configuration>
</plugin>
Expand Down
4 changes: 2 additions & 2 deletions spring-cloud-openfeign-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign</artifactId>
<version>4.1.5-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>..</relativePath> <!-- lookup parent from repository -->
</parent>
<scm>
Expand Down Expand Up @@ -191,7 +191,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.16.1</version>
<version>2.18.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2023 the original author or authors.
* Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,6 +61,11 @@ public class FeignClientProperties {
*/
private boolean decodeSlash = true;

/**
* If {@code true}, trailing slashes at the end of request urls will be removed.
*/
private boolean removeTrailingSlash;

public boolean isDefaultToProperties() {
return defaultToProperties;
}
Expand Down Expand Up @@ -93,6 +98,14 @@ public void setDecodeSlash(boolean decodeSlash) {
this.decodeSlash = decodeSlash;
}

public boolean isRemoveTrailingSlash() {
return removeTrailingSlash;
}

public void setRemoveTrailingSlash(boolean removeTrailingSlash) {
this.removeTrailingSlash = removeTrailingSlash;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -103,12 +116,13 @@ public boolean equals(Object o) {
}
FeignClientProperties that = (FeignClientProperties) o;
return defaultToProperties == that.defaultToProperties && Objects.equals(defaultConfig, that.defaultConfig)
&& Objects.equals(config, that.config) && Objects.equals(decodeSlash, that.decodeSlash);
&& Objects.equals(config, that.config) && Objects.equals(decodeSlash, that.decodeSlash)
&& Objects.equals(removeTrailingSlash, that.removeTrailingSlash);
}

@Override
public int hashCode() {
return Objects.hash(defaultToProperties, defaultConfig, config, decodeSlash);
return Objects.hash(defaultToProperties, defaultConfig, config, decodeSlash, removeTrailingSlash);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2022 the original author or authors.
* Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -145,8 +145,7 @@ public QueryMapEncoder feignQueryMapEncoderPageable() {
@Bean
@ConditionalOnMissingBean
public Contract feignContract(ConversionService feignConversionService) {
boolean decodeSlash = feignClientProperties == null || feignClientProperties.isDecodeSlash();
return new SpringMvcContract(parameterProcessors, feignConversionService, decodeSlash);
return new SpringMvcContract(parameterProcessors, feignConversionService, feignClientProperties);
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2022 the original author or authors.
* Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -67,6 +67,7 @@
* @author Marcin Grzejszczak
* @author Olga Maciaszek-Sharma
* @author Jasbir Singh
* @author Jinho Lee
*/
class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar, ResourceLoaderAware, EnvironmentAware {

Expand Down Expand Up @@ -117,6 +118,9 @@ static String getUrl(String url) {
if (!url.contains("://")) {
url = "http://" + url;
}
if (url.endsWith("/")) {
url = url.substring(0, url.length() - 1);
}
try {
new URL(url);
}
Expand Down Expand Up @@ -321,19 +325,15 @@ private void validate(Map<String, Object> attributes) {
validateFallbackFactory(annotation.getClass("fallbackFactory"));
}

/* for testing */ String getName(Map<String, Object> attributes) {
return getName(null, attributes);
}

String getName(ConfigurableBeanFactory beanFactory, Map<String, Object> attributes) {
String getName(Map<String, Object> attributes) {
String name = (String) attributes.get("serviceId");
if (!StringUtils.hasText(name)) {
name = (String) attributes.get("name");
}
if (!StringUtils.hasText(name)) {
name = (String) attributes.get("value");
}
name = resolve(beanFactory, name);
name = resolve(null, name);
return getName(name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
*
* @author Aram Peres
* @see feign.QueryMap
* @see feign.QueryMapEncoder
* @see org.springframework.cloud.openfeign.FeignClientsConfiguration
* @see org.springframework.cloud.openfeign.annotation.QueryMapParameterProcessor
*/
@Retention(RetentionPolicy.RUNTIME)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2022 the original author or authors.
* Copyright 2013-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -71,7 +71,7 @@ public class FeignBlockingLoadBalancerClient implements Client {
* @deprecated in favour of
* {@link FeignBlockingLoadBalancerClient#FeignBlockingLoadBalancerClient(Client, LoadBalancerClient, LoadBalancerClientFactory, List)}
*/
@Deprecated
@Deprecated(forRemoval = true)
public FeignBlockingLoadBalancerClient(Client delegate, LoadBalancerClient loadBalancerClient,
LoadBalancerProperties properties, LoadBalancerClientFactory loadBalancerClientFactory) {
this.delegate = delegate;
Expand All @@ -84,7 +84,7 @@ public FeignBlockingLoadBalancerClient(Client delegate, LoadBalancerClient loadB
* @deprecated in favour of
* {@link FeignBlockingLoadBalancerClient#FeignBlockingLoadBalancerClient(Client, LoadBalancerClient, LoadBalancerClientFactory, List)}
*/
@Deprecated
@Deprecated(forRemoval = true)
public FeignBlockingLoadBalancerClient(Client delegate, LoadBalancerClient loadBalancerClient,
LoadBalancerClientFactory loadBalancerClientFactory) {
this.delegate = delegate;
Expand Down
Loading