Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESTEasy Reactive: change default name mapping strategy for @RestHeader #13665

Closed
FroMage opened this issue Dec 3, 2020 · 4 comments · Fixed by #16003 or #28851
Closed

RESTEasy Reactive: change default name mapping strategy for @RestHeader #13665

FroMage opened this issue Dec 3, 2020 · 4 comments · Fixed by #16003 or #28851
Assignees
Labels
Milestone

Comments

@FroMage
Copy link
Member

FroMage commented Dec 3, 2020

ATM if you define your param as @RestHeader String contentType it will map to the contentType header, but it should map to Content-Type, so we have to adjust the name mapping rules to make it work for all HTTP headers by default.

@FroMage
Copy link
Member Author

FroMage commented Oct 26, 2022

This turns out to generate the content-Type header for @RestHeader String contentType because it doesn't change the casing: it just hyphenates. Given that headers are case-insensitive, it's not critical, but we should still fix it. Also, this was added to the server, but not the client, making them incompatible when using @RestHeader with no argument.

@geoand geoand self-assigned this Oct 26, 2022
geoand added a commit to geoand/quarkus that referenced this issue Oct 26, 2022
We essentially make the first letter of every part
an uppercase letter for consistence

Part of quarkusio#13665
geoand added a commit to geoand/quarkus that referenced this issue Oct 26, 2022
@geoand
Copy link
Contributor

geoand commented Oct 26, 2022

Are you sure the client doesn't work properly?

Because I am seeing that it does send the proper header name (I also used Wireshark to verify it)

FroMage added a commit to FroMage/quarkus that referenced this issue Oct 26, 2022
… client

- Also use hyphenate on `@RestHeader` on client fields on bean params quarkusio#13665
- Added test for client bean param on fields, getters and regular
  parameters for good measure

Fixes quarkusio#28782
@FroMage
Copy link
Member Author

FroMage commented Oct 26, 2022

Without your fix, I saw the client generate content-Type and not Content-Type. But now I need to redo part of #28782 with your new method, so let's merge this.

@geoand
Copy link
Contributor

geoand commented Oct 26, 2022

👌🏼

geoand added a commit to geoand/quarkus that referenced this issue Oct 26, 2022
We essentially make the first letter of every part
an uppercase letter for consistence

Part of quarkusio#13665
geoand added a commit to geoand/quarkus that referenced this issue Oct 26, 2022
FroMage added a commit to FroMage/quarkus that referenced this issue Oct 26, 2022
… client

- Also use hyphenate on `@RestHeader` on client fields on bean params quarkusio#13665
- Added test for client bean param on fields, getters and regular
  parameters for good measure

Fixes quarkusio#28782
geoand added a commit that referenced this issue Oct 27, 2022
Properly address the change default name mapping strategy for @RestHeader
FroMage added a commit to FroMage/quarkus that referenced this issue Oct 27, 2022
… client

- Also use hyphenate on `@RestHeader` on client fields on bean params quarkusio#13665
- Added test for client bean param on fields, getters and regular
  parameters for good measure

Fixes quarkusio#28782
tmihalac pushed a commit to tmihalac/quarkus that referenced this issue Oct 27, 2022
We essentially make the first letter of every part
an uppercase letter for consistence

Part of quarkusio#13665
tmihalac pushed a commit to tmihalac/quarkus that referenced this issue Oct 27, 2022
@gsmet gsmet modified the milestones: 2.0.0.Alpha1, 2.14.0.Final Oct 28, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 28, 2022
We essentially make the first letter of every part
an uppercase letter for consistence

Part of quarkusio#13665

(cherry picked from commit 684f553)
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 28, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 28, 2022
… client

- Also use hyphenate on `@RestHeader` on client fields on bean params quarkusio#13665
- Added test for client bean param on fields, getters and regular
  parameters for good measure

Fixes quarkusio#28782

(cherry picked from commit 368b496)
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 31, 2022
… client

- Also use hyphenate on `@RestHeader` on client fields on bean params quarkusio#13665
- Added test for client bean param on fields, getters and regular
  parameters for good measure

Fixes quarkusio#28782

(cherry picked from commit 368b496)
@gsmet gsmet modified the milestones: 2.14.0.Final, 2.13.4.Final Oct 31, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 31, 2022
We essentially make the first letter of every part
an uppercase letter for consistence

Part of quarkusio#13665

(cherry picked from commit 684f553)
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 31, 2022
zakkak pushed a commit to zakkak/quarkus that referenced this issue Nov 15, 2022
We essentially make the first letter of every part
an uppercase letter for consistence

Part of quarkusio#13665

(cherry picked from commit 684f553)
zakkak pushed a commit to zakkak/quarkus that referenced this issue Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment