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

@Path with regex containing a single group and | #1093

Open
YvesHenri opened this issue May 30, 2017 · 0 comments
Open

@Path with regex containing a single group and | #1093

YvesHenri opened this issue May 30, 2017 · 0 comments

Comments

@YvesHenri
Copy link

I'm mapping my controllers to be a REST API, so I annotate them with @Path("/api/v{version:XXXXX}").
At first, XXXXX used to be (\\d+\\.?\\d*|\\d*\\.\\d+), however DefaultParametersControl.compilePattern appends ( and ) to my regex, at line 87 (version 4.2.0-RC5), making it TWO groups (((some expression))). This then breaks at line 155, within the fillIntoRequest method of the same class (IndexOutOfBoundsException), since the above path implies a single parameter (version) with a matcher group count of 2.

To fix this, @path must be \\d+\\.?\\d*|\\d*\\.\\d+ (without parentheses), which doesn't sound and look correct to me. I believe there should be some checks before appending both parentheses to the final regex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant