Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regular expressions in path parameters are raising errors in gwtp-rest-dispatch #17

Open
ias-dt opened this issue May 20, 2015 · 1 comment
Labels

Comments

@ias-dt
Copy link

ias-dt commented May 20, 2015

We have a resource which uses regular expressions within the @path annotation like

@Path("search/{version: (\\d+\\.\\d+\\.\\d+\\.\\d+-\\d+)}{binary: (?:/([^/]*))?}")

In the generated RestAction implementation contains a constructor with:

super(httpParameterFactory, defaultDateFormat, HttpMethod.GET, "/search/{version: (\d+\.\d+\.\d+\.\d+-\d+)}{binary: (?:/([^/]*))?}");

addParam(Type.PATH, "version", version);
addParam(Type.PATH, "binary", binary);

So during compilation the compiler complains about invalid escape sequences because \d is not well escaped with two backslashes.

I thought that would be related to the ResourceDelegate stuff but now I think the problem is located in gwtp-dispatch-rest. Maybe the only thing to do is to remove the regular expression stuff in the path because it shouldn't be needed for filling in the parameters:

super(httpParameterFactory, defaultDateFormat, HttpMethod.GET, "/search/{version}{binary}");

addParam(Type.PATH, "version", version);
addParam(Type.PATH, "binary", binary);
@ias-dt ias-dt changed the title Regular expressions in path parameters are raising errors during compile of ResourceDelegates Regular expressions in path parameters are raising errors in gwtp-rest-dispatch May 20, 2015
@Chris-V
Copy link
Member

Chris-V commented Sep 3, 2015

This got out of my head, but we'll prioritize this issue in the current snapshot.

@olafleur olafleur added the bug label Sep 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants