The error means that somewhere in the route you specified something like
[Route("SomeRoute/{someparameter:string}")]
a "string" is not needed because it is the intended type if nothing is specified.
As the error indicates, the DefaultInlineConstraintResolver that comes with the Web API does not have a built-in restriction called string . The supported defaults are as follows:
// Type-specific constraints { "bool", typeof(BoolRouteConstraint) }, { "datetime", typeof(DateTimeRouteConstraint) }, { "decimal", typeof(DecimalRouteConstraint) }, { "double", typeof(DoubleRouteConstraint) }, { "float", typeof(FloatRouteConstraint) }, { "guid", typeof(GuidRouteConstraint) }, { "int", typeof(IntRouteConstraint) }, { "long", typeof(LongRouteConstraint) }, // Length constraints { "minlength", typeof(MinLengthRouteConstraint) }, { "maxlength", typeof(MaxLengthRouteConstraint) }, { "length", typeof(LengthRouteConstraint) }, // Min/Max value constraints { "min", typeof(MinRouteConstraint) }, { "max", typeof(MaxRouteConstraint) }, { "range", typeof(RangeRouteConstraint) }, // Regex-based constraints { "alpha", typeof(AlphaRouteConstraint) }, { "regex", typeof(RegexRouteConstraint) }
Kiran Challa May 01 '14 at 16:40 2014-05-01 16:40
source share