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

Allow LocalDate as path parameter #1781

Open
wimdeblauwe opened this issue Apr 10, 2024 · 1 comment
Open

Allow LocalDate as path parameter #1781

wimdeblauwe opened this issue Apr 10, 2024 · 1 comment

Comments

@wimdeblauwe
Copy link

It is currently possible to use UUID as a path parameter for example and this works fine. However, if you pass a LocalDate object, it does not work.

get("/api/reservations/{date}", LocalDate.now())

The reason seems to be that the LocalDate is serialized to "2024-04-10" and then URL encoded to %222024-04-10%22.

I believe that updating SerializationSupport#isSerializableCandidate() to include LocalDate.class could fix it as it would use the toString() of LocalDate instead of letting a JSON serializer serialize the object.

As a workaround, you can currently manually call the toString() on the LocalDate object:

get("/api/reservations/{date}", LocalDate.now().toString())
@taeyeon-Kim
Copy link

maybe fixed at #1756

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants