Skip to content

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

Open
@Jan-NiklasB

Description

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?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions