You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All the following examples from spec/integration/hanami/router/generation_spec.rb are skipped.
I think these were most likely disabled when we first introduced the trie structure for 2.0, and then we did not reintroduce this behaviour afterwards.
I think this is useful to have. We should have a look to see whether we can achieve it again.
context"variable with optional format"dolet(:router)dodescribed_class.newdoget"/:var(.:format)",as: :a,to: ->{}endendit"generates relative and absolute URLs"dorunner.run!([[:a,"/test.html",{var: "test",format: "html"}],[:a,"/test",{var: "test"}]])endendcontext"variable with optional variable"dolet(:router)dodescribed_class.newdoget"/:var1(/:var2)",as: :a,to: ->{}endendxit"generates relative and absolute URLs"dorunner.run!([[:a,"/foo/bar",{var1: "foo",var2: "bar"}],[:a,"/foo",{var1: "foo"}]])endendcontext"variable with optional variable and format"dolet(:router)dodescribed_class.newdoget"/:var1(/:var2.:format)",as: :a,to: ->{}endendxit"generates relative and absolute URLs"dorunner.run!([[:a,"/test/test2.html",{var1: "test",var2: "test2",format: "html"}]])endendcontext"variable with optional nested variables"dolet(:router)dodescribed_class.newdoget"/:var1(/:var2(/:var3))",as: :a,to: ->{}endendxit"generates relative and absolute URLs"dorunner.run!([[:a,"/var/fooz/baz",{var1: "var",var2: "fooz",var3: "baz"}],[:a,"/var/fooz",{var1: "var",var2: "fooz"}],[:a,"/var",{var1: "var"}]])endend
The text was updated successfully, but these errors were encountered:
There is no reason this can't be done with the current trie implementation. It would just require parsing the route specification containing optional segments, and then adding all of the possible route permutations to the trie.
If optional segments are used a lot, especially multiple optional segments in the same route, the proliferation of routes could lead to slower start times (see #278 for related issue).
I would be happy to work on this when I have a little more time.
All the following examples from
spec/integration/hanami/router/generation_spec.rb
are skipped.I think these were most likely disabled when we first introduced the trie structure for 2.0, and then we did not reintroduce this behaviour afterwards.
I think this is useful to have. We should have a look to see whether we can achieve it again.
The text was updated successfully, but these errors were encountered: