Commit Graph

5639 Commits

Author SHA1 Message Date
rstoyanchev
5b19f6249e Refactoring in ApiVersionInserter
Refine naming of static factory methods, and update them to be
shortcuts for instance creation.

See gh-34919
2025-05-19 09:36:51 +01:00
Sam Brannen
01fea5e7ed Polish Jackson 3 support
- Improve Javadoc.

- Suppress warnings for "removal".

- Update copyright headers.

- Migrate several tests from:
  - MappingJackson2MessageConverter to JacksonJsonMessageConverter
  - Jackson2JsonEncoder to JacksonJsonEncoder
  - Jackson2JsonDecoder to JacksonJsonDecoder
  - Jackson2SmileEncoder to JacksonSmileEncoder
  - Jackson2ObjectMapperBuilder to JsonMapper and XmlMapper
  - MappingJackson2JsonView to JacksonJsonView
  - MappingJackson2HttpMessageConverter to JacksonJsonHttpMessageConverter
  - MappingJackson2XmlHttpMessageConverter to JacksonXmlHttpMessageConverter
2025-05-14 16:55:27 +02:00
rstoyanchev
807cf5e254 Add Consumer methods to HttpRequestValues.Builder
Closes: gh-34870
2025-05-14 15:16:05 +01:00
Sébastien Deleuze
2a29e16456 Deprecate for removal Jackson 2 support
This commit deprecate for removal (likely in a future 7.x release) the
Jackson 2 support in favor of the Jackson 3 one.

Closes gh-33798
2025-05-13 18:02:33 +02:00
Sébastien Deleuze
d4e4a9ae06 Introduce Jackson 3 support for converters
This commit introduces Jackson 3 SmartHttpMessageConverter based
variants of the following Jackson 2 classes (and related dependent classes).

org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter ->
org.springframework.http.converter.AbstractJacksonHttpMessageConverter

MappingJackson2HttpMessageConverter -> JacksonJsonHttpMessageConverter
MappingJackson2SmileHttpMessageConverter -> JacksonSmileHttpMessageConverter
MappingJackson2CborHttpMessageConverter -> JacksonCborHttpMessageConverter
MappingJackson2XmlHttpMessageConverter -> JacksonXmlHttpMessageConverter
MappingJackson2YamlHttpMessageConverter -> JacksonYamlHttpMessageConverter

They use hints instead of MappingJacksonValue and MappingJacksonInputMessage
to support `@JsonView` and FilterProvider.

Jackson 3 support is configured if found in the classpath otherwise
fallback to Jackson 2.

JacksonHandlerInstantiator needs to be enabled explicitly if needed.

See gh-33798
2025-05-13 17:53:28 +02:00
Sébastien Deleuze
7a8db31dc3 Introduce Jackson 3 support for HandlerInstantiator
This commit introduces a
org.springframework.http.support.JacksonHandlerInstantiator Jackson 3
variant of org.springframework.http.converter.json.SpringHandlerInstantiator
Jackson 2 class.

See gh-33798
2025-05-13 17:51:04 +02:00
Sébastien Deleuze
5cb2f870d0 Introduce Jackson 3 support for codecs
This commit introduces Jackson 3 variants of the following Jackson 2
classes (and related dependent classes).

org.springframework.http.codec.json.Jackson2CodecSupport ->
org.springframework.http.codec.JacksonCodecSupport

org.springframework.http.codec.json.Jackson2Tokenizer ->
org.springframework.http.codec.JacksonTokenizer

org.springframework.http.codec.json.Jackson2SmileDecoder ->
org.springframework.http.codec.smile.JacksonSmileDecoder

org.springframework.http.codec.json.Jackson2SmileEncoder ->
org.springframework.http.codec.smile.JacksonSmileEncoder

Jackson2CborDecoder -> JacksonCborDecoder
Jackson2CborEncoder -> JacksonCborEncoder
Jackson2JsonDecoder -> JacksonJsonDecoder
Jackson2JsonEncoder -> JacksonJsonEncoder

Jackson 3 support is configured if found in the classpath otherwise
fallback to Jackson 2.

See gh-33798
2025-05-13 17:51:04 +02:00
Juergen Hoeller
254a55d217 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-05-13 16:31:05 +02:00
Juergen Hoeller
73f1c5a189 Polishing 2025-05-13 16:08:57 +02:00
Martin Mois
261862076c Use system properties in ReactorClientHttpRequestFactory
Closes gh-34850

Signed-off-by: Martin Mois <martin.mois@gmail.com>
2025-05-13 15:18:03 +02:00
rstoyanchev
97d5f7f07d Fix filtering in HttpServiceProxyRegistryFactoryBean
Closes gh-34867
2025-05-07 22:53:33 +01:00
rstoyanchev
e5d4d7c13c Refactor DefaultApiVersionInserter 2025-05-06 20:36:56 +01:00
rstoyanchev
22e7f24731 Add defaultApiVersion to RestClient and WebClient
Closes gh-34857
2025-05-06 19:07:58 +01:00
Brian Clozel
4a99fa8846 Merge branch '6.2.x' 2025-05-05 14:51:34 +02:00
Brian Clozel
6f11711e27 Fix HttpClient 5.3.x request config compatibility
As of gh-33806, the HttpComponents client request factory is forward
compatible with the 5.4+ versions of that library for configuring HTTP
request configuration.

This change would not tkae into account configuration set at the Spring
level because it would consider the default `RequestConfig` instance as
a custom one. This commit ensures that Spring sets its own configuration
if no custom configuration was set for all supported HttpComponents
generations.

Fixes gh-34851
2025-05-05 14:38:30 +02:00
rstoyanchev
67f3ff574f Polishing in HTTP service registry 2025-05-01 11:00:32 +01:00
Phillip Webb
42e854e5ff Polish AbstractHttpServiceRegistrar.DefaultGroupSpec
Remove `DefaultGroupRegistry` since it's not really needed and polish
`DefaultGroupSpec` a little.
2025-05-01 11:00:32 +01:00
Phillip Webb
d2246162c3 Polish GroupsMetadata.Registration
Unify `Registration` and `DefualtRegistration` into a single
class since they are both package-private and the interface
isn't really needed.
2025-05-01 11:00:32 +01:00
Phillip Webb
abbee1a050 Use bean class loader when creating interface clients
Update interface client code to replace `GroupsMetadata.loadClass` calls
with `ClassUtils.resolveClassName` passing in the bean class loader.

Since the bean class loader in injected after construction, some minor
refactoring has been applied to `HttpServiceProxyRegistryFactoryBean`.
The class now stores `GroupsMetadata` and only loads the types in
in `afterPropertiesSet`.

The `HttpServiceProxyFactory` class has also been updated to ensure
that the proxy is created using the class loader of the service
type, rather than the thread context class loader.

Fixes gh-34846
2025-05-01 11:00:32 +01:00
Juergen Hoeller
d0a1ba5092 Merge branch '6.2.x' 2025-04-30 17:56:36 +02:00
Juergen Hoeller
4466548f53 Align parameter javadoc with nullable signature
Closes gh-34845
2025-04-30 17:55:39 +02:00
rstoyanchev
86b5679516 Add remaining change from merge 2025-04-28 14:40:52 +01:00
rstoyanchev
8375962813 Merge branch '6.2.x' 2025-04-28 14:29:58 +01:00
rstoyanchev
c88ba6c90e Polishing contribution
Closes gh-34812
2025-04-28 14:23:30 +01:00
Yanming Zhou
d7c13d6518 HttpEntity.EMPTY should be immutable
See gh-34812

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-04-28 14:22:59 +01:00
rstoyanchev
d8503daa1f Revise how bodyType is set for 7.0 codebase
See gh-34793
2025-04-25 21:41:11 +01:00
rstoyanchev
fed6e9b3c3 Merge branch '6.2.x' 2025-04-25 21:33:03 +01:00
rstoyanchev
c48ff357dc HTTP Service proxy sets body type
Closes gh-34793
2025-04-25 21:03:00 +01:00
Sébastien Deleuze
ead76b6317 Merge branch '6.2.x' 2025-04-24 10:39:39 +02:00
Sébastien Deleuze
56eb135608 Fix AbstractJackson2HttpMessageConverter nullness
This commit makes AbstractJackson2HttpMessageConverter#getObjectMappersForType
return value non nullable as an empty map is returned in case of no
registrations.

Closes gh-34811
2025-04-24 10:37:30 +02:00
rstoyanchev
2a3e7ea3f9 Merge branch '6.2.x' 2025-04-23 12:11:28 +01:00
rstoyanchev
858c2bd270 Polishing contribution
Closes gh-34783
2025-04-23 10:54:52 +01:00
whl
124582d910 Fix expansion of query param with same name
See gh-34783

Signed-off-by: whl <whlit.cola@gmail.com>
2025-04-23 10:54:52 +01:00
Juergen Hoeller
f2dd7b01cd Consistent final @Nullable declarations 2025-04-22 12:25:01 +02:00
Olga Maciaszek-Sharma
b24f4edbec HttpServiceGroupConfigurer extends Ordered
Closes gh-34739

Signed-off-by: Olga Maciaszek-Sharma <olga.maciaszek-sharma@broadcom.com>
2025-04-15 17:33:34 +01:00
rstoyanchev
4599ad4168 HttpServiceProxyRegistry Javadoc updates
See gh-33992
2025-04-15 17:27:48 +01:00
rstoyanchev
40853825dc Add HttpRequestValues.Processor
Closes gh-34699
2025-04-15 17:25:34 +01:00
Stéphane Nicoll
88e773ae24 Add AOT support for Registry of HTTP Interface Proxies
This commit adds AOT support for restoring the state of the
HttpServiceProxyRegistry. This generates code for the groupsMetadata
as well as for the creation of the client proxies.

Closes gh-34750
2025-04-15 17:29:43 +02:00
Sam Brannen
5fb37e3133 Polishing 2025-04-15 15:19:34 +02:00
rstoyanchev
76ba02ec3e Update HttpServiceProxyRegistry
See gh-33992
2025-04-14 17:45:49 +01:00
Sam Brannen
23aea5c402 Merge branch '6.2.x' 2025-04-14 11:32:48 +02:00
Sam Brannen
7095f4cb66 Use proper casing for parameter and variable names 2025-04-14 11:25:40 +02:00
Sam Brannen
a22d204681 Remove duplicate words in Java source code
Discovered using regular expression: \b(\w+)\s+\1\b[^(}]
2025-04-14 11:24:55 +02:00
Sam Brannen
df4868bf83 Merge branch '6.2.x' 2025-04-10 16:49:43 +02:00
Sam Brannen
cd987fc104 Update Javadoc to stop mentioning 5.3.x as the status quo
Closes gh-34740
2025-04-10 16:40:04 +02:00
Sébastien Deleuze
eee45c3583 Refine CORS preflight requests handling with no configuration
This commit makes CORS preflight requests handling more flexible
by just skipping setting CORS response headers when no
configuration is defined instead of rejecting them.

That will have the same effect on user agent side (the preflight
request will be considered as not authorized and the actual
request not performed) but is more flexible and more efficient.

Closes gh-31839
2025-04-04 21:32:38 +02:00
Sam Brannen
a9cab2a3f1 Polishing 2025-04-03 11:19:53 +02:00
Sam Brannen
d10d8e98c2 Remove default value for Container annotation 2025-04-03 10:59:33 +02:00
Sam Brannen
6576c52ed3 Remove unused code 2025-04-03 10:58:51 +02:00
Sam Brannen
71b6dcfa7e Merge branch '6.2.x' 2025-04-03 10:48:28 +02:00