Our Request Params have hyphens within their names.
The regex in the UriTemplate cannot handle the '-' within their names.
private static final Pattern VARIABLE_REGEX = Pattern.compile("\\{([\\?\\&#/]?)([\\w\\,*]+)\\}");
Can this regex get changed to:
private static final Pattern VARIABLE_REGEX = Pattern.compile("\\{([\\?\\&#/]?)([\\w\\,*-]+)\\}");
?
Otherwise we end up with the following exception:
java.lang.IllegalArgumentException: Illegal character in query at index 101: XXXXXXXXX
at java.net.URI.create(URI.java:852)
at org.springframework.hateoas.UriTemplate.expand(UriTemplate.java:219)
at org.springframework.hateoas.client.Traverson$TraversalBuilder.traverseToFinalUrl(Traverson.java:384)
at org.springframework.hateoas.client.Traverson$TraversalBuilder.toObject(Traverson.java:321)
Our Request Params have hyphens within their names.
The regex in the UriTemplate cannot handle the '-' within their names.
private static final Pattern VARIABLE_REGEX = Pattern.compile("\\{([\\?\\&#/]?)([\\w\\,*]+)\\}");
Can this regex get changed to:
private static final Pattern VARIABLE_REGEX = Pattern.compile("\\{([\\?\\&#/]?)([\\w\\,*-]+)\\}");
?
Otherwise we end up with the following exception: