NancyFx / Nancy

Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono
http://nancyfx.org
MIT License
7.16k stars 1.47k forks source link

Route without optional route segments with a constraint not routed #2962

Open crm76 opened 5 years ago

crm76 commented 5 years ago

Given /seg/{opt?:int}

Navigating to /seg/1 works.

But navigating to /seg does not (404).

Removing the constraint (:int) works as expected.

cloudhunter89 commented 5 years ago

Have a look at: Make Route Constraints Optional #1377 I think the syntax is expected to be /seg/{opt:int?}

crm76 commented 5 years ago

When that syntax is used neither /seg/1 nor /seg work. ¯_(ツ)_/¯

cloudhunter89 commented 5 years ago

Uhh... possibly left as a feature request. Digging a little further #1418 seems to indicate this has not been implemented.