Having a few issues with Swashbuckle and mostly routing.
So I am working with an API that has controller specific routes defined for some and a generic default route for all others. Both have defaults included in the route specification.
Specific route example:
config.Routes.MapHttpRoute(
name: "Infobutton",
routeTemplate: "api/Infobutton/{clientId}",
defaults: new
{
controller = "Infobutton",
maxresults = 0,
firstresult = 0,
format = "xhtml",
urlType = "x",
alphaSort = "",
showAll = "false",
spellcheck = "true",
showCategories = "false",
showSnippet = "false",
showGroups = "false",
disableAltSearch = "false",
requireCode = "false",
forceRelevance = "true",
searchtype="",
showSearchedTerms = "true",
searchId = "",
omitBlanks = "false"
}
);
Default route example:
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new
{
id = RouteParameter.Optional,
query = "",
category = "",
cpt = "",
diagnosis = "",
group = "",
icd10 = "",
icd9 = "",
keyword = "",
title = "",
language = "en",
maxresults = 0,
firstresult = 0,
fields = "",
format = "xml",
encoding = "",
printsize = "",
images = "",
snomed = "",
age = 0,
gender = "",
loinc = "",
ndc = "",
rxnorm = "",
browse = "",
urlType = "",
alphaSort = "",
showAll = "false",
spellcheck = "true",
resultLanguage = "en",
showGroups = "false",
disableAltSearch = "false",
requireCode = "false",
forceRelevance = "false",
showSearchedTerms = "false",
omitBlanks = "false"
}
);
Issues I am running across:
Since the generic route handler is a "catch-all" swagger picks up the more specific route (Infobutton in this case) and the generic one, which results in two functions showing up in the Swagger UI.
Having a Get call with parameters that appear in defaults results in the Get call not showing at all in the UI.
Any ideas would be greatly appreciated!