Skip to content

Conversation

bombo-dev
Copy link
Contributor

Problem

When using the @SpringQueryMap annotation, it was difficult to discover the existence of the QueryMapEncoder class.
The reference path is as follows:
@SpringQueryMap -> @QueryMap -> @Param Usage All

Additionally, when using @SpringQueryMap, the default injected implementation is FieldQueryMapEncoder.
However, in FeignClientsConfiguration, the injected bean can change depending on the @ConditionalOnClass condition.

@Bean
@ConditionalOnClass(name = "org.springframework.data.domain.Pageable")
@ConditionalOnMissingBean
public QueryMapEncoder feignQueryMapEncoderPageable() {
	PageableSpringQueryMapEncoder queryMapEncoder = new PageableSpringQueryMapEncoder();
	if (springDataWebProperties != null) {
		queryMapEncoder.setPageParameter(springDataWebProperties.getPageable().getPageParameter());
		queryMapEncoder.setSizeParameter(springDataWebProperties.getPageable().getSizeParameter());
		queryMapEncoder.setSortParameter(springDataWebProperties.getSort().getSortParameter());
	}
	return queryMapEncoder;
}

Although FieldQueryMapEncoder is marked as deprecated in QueryMapEncoder, it still functions as the default implementation.

Solution

I have explicitly specified this behavior in the annotation documentation.
I encountered this issue while debugging, and it took me a long time to identify the cause.
By adding this information, I hope others can find the relevant details more quickly.

Consideration

I initially considered adding the note:

"The default implementation is FieldQueryMapEncoder, but it can change to PageableSpringQueryMapEncoder depending on the conditions."

However, since this behavior is subject to change, I decided not to include it.
If necessary, I am open to adding this detail.

ryanjbaxter and others added 30 commits August 7, 2024 11:22
…cloud#1045)

Bumps [com.google.protobuf:protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.25.3 to 3.25.4.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](protocolbuffers/protobuf@v3.25.3...v3.25.4)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-java
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…g-cloud#1042)

Bumps [com.fasterxml.jackson.dataformat:jackson-dataformat-smile](https://github.com/FasterXML/jackson-dataformats-binary) from 2.17.1 to 2.17.2.
- [Commits](FasterXML/jackson-dataformats-binary@jackson-dataformats-binary-2.17.1...jackson-dataformats-binary-2.17.2)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.dataformat:jackson-dataformat-smile
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
updated-dependencies:
- dependency-name: "@antora/collector-extension"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@springio/asciidoctor-extensions](https://github.com/spring-io/asciidoctor-extensions) from 1.0.0-alpha.10 to 1.0.0-alpha.13.
- [Changelog](https://github.com/spring-io/asciidoctor-extensions/blob/main/CHANGELOG.adoc)
- [Commits](spring-io/asciidoctor-extensions@v1.0.0-alpha.10...v1.0.0-alpha.13)

---
updated-dependencies:
- dependency-name: "@springio/asciidoctor-extensions"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…d#1063)

Bumps [antora](https://gitlab.com/antora/antora) from 3.2.0-alpha.4 to 3.2.0-alpha.6.
- [Changelog](https://gitlab.com/antora/antora/blob/main/CHANGELOG.adoc)
- [Commits](https://gitlab.com/antora/antora/compare/v3.2.0-alpha.4...v3.2.0-alpha.6)

---
updated-dependencies:
- dependency-name: antora
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
# Conflicts:
#	docs/package.json
* Make Content-Encoding configurable

A new configuration property was added to make the Content-Encoding
configurable when using the feign request compression. The default
values are the same as the previous hardcoded values.

Closes issue 1048
Bumps commons-io:commons-io from 2.16.1 to 2.17.0.

---
updated-dependencies:
- dependency-name: commons-io:commons-io
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…cloud#1090)

Bumps [com.google.protobuf:protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.25.4 to 3.25.5.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](protocolbuffers/protobuf@v3.25.4...v3.25.5)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-java
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
spring-cloud#1087)

Bumps [com.google.protobuf:protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.25.4 to 3.25.5.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](protocolbuffers/protobuf@v3.25.4...v3.25.5)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-java
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [io.github.openfeign:feign-bom](https://github.com/openfeign/feign) from 13.3 to 13.4.
- [Release notes](https://github.com/openfeign/feign/releases)
- [Changelog](https://github.com/OpenFeign/feign/blob/master/CHANGELOG.md)
- [Commits](OpenFeign/feign@13.3...13.4)

---
updated-dependencies:
- dependency-name: io.github.openfeign:feign-bom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* polishing feignClientsRegistrar

* update the date in the license and add author
…g-cloud#1097)

Bumps [com.fasterxml.jackson.dataformat:jackson-dataformat-smile](https://github.com/FasterXML/jackson-dataformats-binary) from 2.17.2 to 2.18.0.
- [Commits](FasterXML/jackson-dataformats-binary@jackson-dataformats-binary-2.17.2...jackson-dataformats-binary-2.18.0)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.dataformat:jackson-dataformat-smile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…onfiguration In SpringQueryMap

- Added @see references to feign.QueryMapEncoder and FeignClientsConfiguration
- Improved documentation for better discoverability

Signed-off-by: Bombo-Dev <[email protected]>
@OlgaMaciaszek OlgaMaciaszek moved this to In Progress in 2023.0.6 Mar 12, 2025
@OlgaMaciaszek OlgaMaciaszek moved this to In Progress in 2024.0.1 Mar 12, 2025
@OlgaMaciaszek OlgaMaciaszek moved this to In Progress in 2025.0.0-M3 Mar 12, 2025
@OlgaMaciaszek OlgaMaciaszek added this to the 4.1.5 milestone Mar 12, 2025
Copy link
Collaborator

@OlgaMaciaszek OlgaMaciaszek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @bombo-dev, thanks for submitting the PR. Looks good, but could you submit this against 4.1.x instead of main, so that it also gets picked to earlier release trains?

@bombo-dev bombo-dev changed the base branch from main to 4.1.x March 12, 2025 23:26
@bombo-dev
Copy link
Contributor Author

Hello @bombo-dev, thanks for submitting the PR. Looks good, but could you submit this against 4.1.x instead of main, so that it also gets picked to earlier release trains?

Hello @OlgaMaciaszek, thank you for your response.
I have changed the base branch from main to 4.1.x. I appreciate your guidance.

@OlgaMaciaszek
Copy link
Collaborator

Hello @bombo-dev the base branch cannot be just changed. The easiest way to correctly change the branch would be to close this PR and create a new one by applying your commits to the 4.1.x branch.

@bombo-dev bombo-dev closed this Mar 14, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in 2023.0.6 Mar 14, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in 2025.0.0-M3 Mar 14, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in 2024.0.1 Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done
Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

10 participants