c# - Methods don't show in Swagger UI (w/ Swashbuckle) but no error message -


i'm writing api swashbuckle, running issues. have 3 methods in acontroller:

[responsetype(typeof(ienumerable<a>))] public ihttpactionresult get(int bid);  [responsetype(typeof(ienumerable<a>))] public ihttpactionresult get(ilist<int> cids);  [responsetype(typeof(ienumerable<a>))] public ihttpactionresult get(int bid, ilist<int> cids); 

i expect either error overloading endpoints or work single method 2 optional parameters, covering cases. instead, i'm getting second method show, seems arbitrary.

i'm wondering, there way 3 work, , also, there reason beyond chance second method shown in ui? thanks!

to answer first question, able 3 methods work defining different endpoints them. each method, add following attribute: [httpget("the_end_point_you_want")].

ie)

[httpget("/getbid/{bid})") [responsetype(typeof(ienumerable<a>))] public ihttpactionresult get(int bid)  [httpget("/getlistcid")] [responsetype(typeof(ienumerable<a>))] public ihttpactionresult get(ilist<int> cids) 

for second question, unsure why second chosen guess how swashbuckle retrieves each method.

hope helps


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -