You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/03/25 11:45:13 UTC
[GitHub] [servicecomb-java-chassis] heyile commented on a change in pull
request #1150: [SCB-1220] consumer side support path param regex
heyile commented on a change in pull request #1150: [SCB-1220] consumer side support path param regex
URL: https://github.com/apache/servicecomb-java-chassis/pull/1150#discussion_r268601196
##########
File path: common/common-rest/src/test/java/org/apache/servicecomb/common/rest/definition/path/URLPathBuilderTest.java
##########
@@ -93,14 +93,30 @@ public void testMultiQuery() throws Exception {
urlPathBuilder.createRequestPath(args));
}
+ @Test
+ public void testRegexPathParam() throws Exception {
+ Map<String, RestParam> paramMap = new LinkedHashMap<>();
+ addParam("p0", int.class, PathParameter::new, paramMap);
+ addParam("p1", String.class, PathParameter::new, paramMap);
+ addParam("q0", int.class, QueryParameter::new, paramMap);
+ addParam("q1", String.class, QueryParameter::new, paramMap);
+
+ URLPathBuilder urlPathBuilder = new URLPathBuilder("/path/{p0 : .*}/and/{p1:.*}", paramMap);
Review comment:
what's the means of support regex. do not need check if the value meets the requirements of regex ?
```
URLPathBuilder urlPathBuilder = new URLPathBuilder("/path/{p0 : .*}/and/{p1:[0-10]*}", paramMap);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services