hanami/router

Optional tokens are not being accepted by 'path'

sergey-koba-mobidev opened this issue · 1 comments

Hi,

Thank you for nice gem! I am using it as standalone gem in my Rack app.
I have such route in it:
get '(/:lang)/article/:slug', lang: /en/, to: 'posts#show', as: :show_post

When I call @router.path(:show_post, slug: 'blabla') is works as expected.
But trying to do
@router.path(:show_post, slug: 'blabla', lang: 'en')
raises exception:
Hanami::Routing::InvalidRouteException: No route (path) could be generated for :show_post - please check given arguments

Maybe I am doing something wrong, or is it a bug?
Thx in advance!

Sorry, figured out it was a constraint exception