Skip to content

Commit 013d2da

Browse files
senhalilLeFnord
andauthored
Fixes the regexp used for parsing routes (#844)
* 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 <[email protected]>
1 parent 908a7a8 commit 013d2da

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
### 1.4.4
1+
### 1.5.5
2+
3+
#### Features
4+
5+
* [#862](https://github.com/ruby-grape/grape-swagger/pull/862): Allow using nicknames for body definitions - [@magni-](https://github.com/magni-)
26

37
#### Fixes
48

@@ -12,6 +16,7 @@
1216
* [#846](https://github.com/ruby-grape/grape-swagger/pull/846): Fixes oapi rake tasks, allows generating sepcs for different API versions.
1317
* [#852](https://github.com/ruby-grape/grape-swagger/pull/852): Fix example to work without error - [@takahashim](https://github.com/takahashim)
1418
* [#853](https://github.com/ruby-grape/grape-swagger/pull/853): Add webrick gem so that example works in Ruby 3.x - [@takahashim](https://github.com/takahashim)
19+
* [#844](https://github.com/ruby-grape/grape-swagger/pull/844): Fixes the regexp used for parsing routes - [@senhalil](https://github.com/senhalil)
1520
* [#862](https://github.com/ruby-grape/grape-swagger/pull/862): Allow using nicknames for body definitions - [@magni-](https://github.com/magni-)
1621
* Your contribution here.
1722

lib/grape-swagger.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def combine_routes(app, doc_klass)
3131

3232
# want to match emojis … ;)
3333
# route_match = route_match
34-
# .match('\/([\p{Alnum}|\p{Emoji}|\-|\_]*?)[\.\/\(]') || route_match.match('\/([\p{Alpha}|\p{Emoji}|\-|\_]*)$')
35-
route_match = route_match.match('\/([\p{Alnum}|\-|\_]*?)[\.\/\(]') || route_match.match('\/([\p{Alpha}|\-|\_]*)$')
34+
# .match('\/([\p{Alnum}p{Emoji}\-\_]*?)[\.\/\(]') || route_match.match('\/([\p{Alpha}\p{Emoji}\-\_]*)$')
35+
route_match = route_match.match('\/([\p{Alnum}\-\_]*?)[\.\/\(]') || route_match.match('\/([\p{Alpha}\-\_]*)$')
3636
next unless route_match
3737

3838
resource = route_match.captures.first

0 commit comments

Comments
 (0)