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

Fixes the regexp used for parsing routes #844

Merged
merged 3 commits into from
Jul 26, 2022
Merged

Conversation

senhalil
Copy link
Contributor

When called add_swagger_documentation raises the following warning which is due to vertical bars | since they are parsed as literal characters and not as OR's in a character set [] definition.

grape-swagger-1.4.2/lib/grape-swagger.rb:35: warning: character class has duplicated range: /\/([\p{Alnum}|\-|\_]*?)[\.\/\(]/

@senhalil
Copy link
Contributor Author

senhalil commented Nov 19, 2021

It doesn't look like the broken tests are due to my PR but I can fix them if that is the case.

In a character set, vertical bars `|` are treated as a proper character and not as an OR.

They are not needed since character set applies the OR logic automatically.
@senhalil
Copy link
Contributor Author

I just rebased the PR. Can someone give me some feedback -- maybe @LeFnord ?

@LeFnord
Copy link
Member

LeFnord commented Jul 26, 2022

thanks @senhalil … makes sense to me

@LeFnord LeFnord merged commit 013d2da into ruby-grape:master Jul 26, 2022
@senhalil senhalil deleted the patch-1 branch July 26, 2022 08:19
aka-momo pushed a commit to aka-momo/grape-swagger that referenced this pull request Feb 8, 2023
* Fix: incorrect regexp character set definition

In a character set, vertical bars `|` are treated as a proper character and not as an OR.

They are not needed since character set applies the OR logic automatically.

* Update CHANGELOG.md

Co-authored-by: peter scholz <pscholz.le@gmail.com>
Bhacaz pushed a commit to Bhacaz/grape-swagger that referenced this pull request Aug 31, 2023
* Fix: incorrect regexp character set definition

In a character set, vertical bars `|` are treated as a proper character and not as an OR.

They are not needed since character set applies the OR logic automatically.

* Update CHANGELOG.md

Co-authored-by: peter scholz <pscholz.le@gmail.com>
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

Successfully merging this pull request may close these issues.

2 participants