Skip to content

Request parameters encoding doesn't work in v1 of the spec #1279

Closed
@erikpragt-connectid

Description

@erikpragt-connectid

Hi @deki ,

We found another issue, which is related the encoding of parameters. For example, when we send a timestamp, we could send the timestamp either as time=1970-01-01T00:00:00.004Z or time=1970-01-01T00%3A00%3A00.004Z. When we send this through a Function URL (so, v2 of the spec), all works well, we can call our endpoint using an encoded an un-encoded value.

However, when we use the ALB, which used v1, the unencoded version works, but when we encode the parameters, there's an exception in the code:

.w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Method parameter 'time': Failed to convert value of type 'java.lang.String' to required type 'java.time.Instant'; Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.RequestParam java.time.Instant] for value [1970-01-01T00%3A00%3A00.904Z]]

I have a demo application if you need one, it doesn't do much, except for consuming a request parameter:

    @GetMapping
    public Instant time(@RequestParam Instant time) {
        return time;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions