Skip to content

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

Description

@ias-dt

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions