-1

I am using the findByAllIds method of crud repository in spring boot. I would like to pass the list of id's with a comma seperating them in my @pathvariable, the id's are of type uuid so whenever i do that, i get "Failed to convert value of type 'java.lang.String' to required type 'java.util.UUID'; nested exception is java.lang.IllegalArgumentException: Invalid UUID string" error.

1 Answers1

1

From the code in your comment I cannot see anything indicated as a @Pathvariable, but even if it is, you mentioned that you are passing multiple UUIDs separated by a comma. However, you only list a single UUID parameter in your method call. If you would attempt to pass multiple UUID strings into that, I would indeed expect the error you're getting, that is java.lang.IllegalArgumentException: Invalid UUID string

Have you tried making the @Pathvariable an array? i.e. UUID[] ids? Or as a list, i.e. List<UUID> ids? Both are possible according to Passing an Array or List to @Pathvariable - Spring/Java

Sebastiaan van den Broek
  • 5,818
  • 7
  • 40
  • 73