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

Parameter error for string(date-time) endpoints of API #42

Open
Jan-NiklasB opened this issue Mar 1, 2024 · 0 comments
Open

Parameter error for string(date-time) endpoints of API #42

Jan-NiklasB opened this issue Mar 1, 2024 · 0 comments

Comments

@Jan-NiklasB
Copy link

When sending a request to endpoints requirering a date-time parameter there seems to be a problem in parsing the datetime from string.

I tried the following on the swagger site:

https://my-tak-server.com/Marti/api/cot/xml/ANDROID-XXXXXXX/all?start=2024-02-28T00:00:00Z&end=2024-03-01T18:00:00Z

This gives the following error:

Failed to convert value of type 'java.lang.String' to required type 'java.util.Date'; Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.RequestParam @org.springframework.format.annotation.DateTimeFormat java.util.Date] for value ['2024-02-28T00:00:00Z']"

I also tried other formats, which gave the same error or errored on the swagger-site already

After googling this error it seems like it's a code-site error:

https://www.baeldung.com/spring-date-parameters

Can someone validate this or give me a hint how to doe the request correctly?

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

1 participant