0

I have an Spring-Web controller that is supposed to accept UUIDs as parameters:

@RequestMapping(value = "/searchBy", method = RequestMethod.GET)
public final String searchBy(@RequestParam UUID id) {

//...

}

I am sending to it a simple GET request with a UUID in the form of a String:

http://localhost:8080/myApp/searchBy?id=6ef4269d-d5ed-436b-9a26-9f0ffc39a795

But unfortunately it is sending me a 400 response saying Invalid UUID

What I am missing? The version of Spring Boot I use is: 2.0.2.RELEASE

babylonian
  • 133
  • 2
  • 10
  • 1
    Have you tried `@RequestParam("id")` and `@RequestMapping(params = "id")`? – nortontgueno Feb 04 '19 at 17:10
  • 1
    Your code is working, at least on my system. Can you maybe provide more information about the code in //..? Have you tried getting the UUID as a String and then parsing it? – Aaron Stein Feb 04 '19 at 18:30
  • indeed the code works in my computer. could it be an error in the libraries? maybe you are using different spring versions... – Jose Luis Feb 04 '19 at 19:39

0 Answers0