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

Quarkus REST: setting a LocalDate parameter to an empty value results in a 400 instead of a null parameter #40833

Closed
FroMage opened this issue May 24, 2024 · 3 comments · Fixed by #42468
Labels
area/rest kind/bug Something isn't working
Milestone

Comments

@FroMage
Copy link
Member

FroMage commented May 24, 2024

Given this endpoint:

@POST
public void foo(@RestForm LocalDate date){}

And this payload:

date=

I get a 400 from Quarkus REST. Probably because TemporalParamConverter doesn't handle empty strings? I think it should be set to a null value. I also assume other temporal types have the same issue.

@FroMage FroMage added the kind/bug Something isn't working label May 24, 2024
Copy link

quarkus-bot bot commented May 24, 2024

/cc @geoand (resteasy-reactive), @stuartwdouglas (resteasy-reactive)

@DShivansh
Copy link
Contributor

Hi @FroMage @geoand @ia3andy
I was thinking that we can put a null check in the function convert to return null that is present inside TemporalParamConverter abstract class, does this seem like a good idea?

@geoand
Copy link
Contributor

geoand commented Jun 30, 2024

You can certainly give it a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants