2

I need to support wrapping a list of ids in curly braces with Spring GetMapping annotation.

When I use square brackets like this, it works:

@GetMapping("/get/[{ids}]")

but double the braces and everything blows up

@GetMapping("/get/{{ids}}")

with the exception: org.springframework.web.util.pattern.PatternParseException: Not allowed to nest variable captures

Schenz
  • 1,113
  • 8
  • 14

1 Answers1

-1

Possible duplicate of REST api: requesting multiple resources in a single get

But, since you know how to request multiple resources using the [] notation; I'm giving my thoughts here on this.

I'd suggest not using the double braces as its not a recommended pattern (see: REST api: requesting multiple resources in a single get) for fetching multiple resources.

If you still want/have to use the double brace pattern, you can do workarounds like URL encoding or writing your own argument resolver.

Sachin
  • 901
  • 2
  • 10
  • 23