A typed parameter in a Nancy route is included without type in a route path in swagger.json.
Actual Behavior
The parameter type remains in the route path in swagger.json.
Steps to Reproduce the Problem
Use a Nancy route with typed parameter like /something/{id:guid}
Generate swagger.json
Inspect the route path, it is /something/{id:guid}
Analysis
SwaggerRouteData contains a properly sanitized Path property, but it appears that the actual route path being used is the key of the dictionary returned by ISwaggerMetadataProvider.RetrieveSwaggerPaths, and that is the raw route path.
My workaround in a custom metadata provider:
protected override IDictionary<string, SwaggerRouteData> RetrieveSwaggerPaths(NancyContext context)
{
var result = base.RetrieveSwaggerPaths(context);
return result.Values.ToDictionary(rd => rd.Path);
}
Expected Behavior
A typed parameter in a Nancy route is included without type in a route path in swagger.json.
Actual Behavior
The parameter type remains in the route path in swagger.json.
Steps to Reproduce the Problem
/something/{id:guid}
/something/{id:guid}
Analysis
SwaggerRouteData
contains a properly sanitizedPath
property, but it appears that the actual route path being used is the key of the dictionary returned byISwaggerMetadataProvider.RetrieveSwaggerPaths
, and that is the raw route path.My workaround in a custom metadata provider:
Specifications