I’m working with a WebApi that is passed the HttpRequestMessage class which is always available in the ASP.NET WebApi pipeline. However, when the documentation is exposed in Swashbuckle, I get a textbox that shows up where it expects me to enter a value for this parameter.
The operation is defined as follows…
public async TaskGet(HttpRequestMessage request)
The problem is, when the documentation is emitted I end up with this ugly mess...
I set about finding a way to instruct Seashbuckle to ignore this parameter, and finding there isn’t anything in the box I set about writing a filter that would do this for me.
In Swashbuckle you can plug-in operation “filters” that can be used to alter the emitted data – the filter is passed the context of the operation being emitted, and you can monkey around with the data that pops out. All I had to do then was create a filter that would look for this datatype, and remove the corresponding data from the results. I ended up with this…
public class IgnoreHttpRequestMessageOperationFilter : IOperationFilter { public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) { apiDescription.ParameterDescriptions .Where(desc => desc.ParameterDescriptor.ParameterType == typeof(HttpRequestMessage)) .ToList() .ForEach(param => { var toRemove = operation.parameters .SingleOrDefault(p => p.name == param.Name); if (null != toRemove) operation.parameters.Remove(toRemove); }); } }
With that class in place, I just needed to plug this in to the swagger config file as follows...
c.OperationFilter();
And Bob's you're uncle...
131 comments:
Cool! thanks for pointing this out! On stackowerflow they suggest to rewrite controllers not to use request as a parameter, which is not suitable for us.
I was searching solution for the same problem, Thanks to you :)
Good job mate. Exactly what I was looking for
Worked like charm. Thank you.
works like a magic ... thanks a ton
I have a huge amount of applications in my phone so I was scared when I lost it. https://cellspyapps.org/track-phone-number/ helped me to track my phone number and find it)
Be sure to check out the new persuasive essay topics.
Blog Commenting: An unmatched and nonpareil post i have ever seen. The content is so appealing that it has created an impulse to avail Assignment Help Singapore services.
Remarkable post! That's a lot of information. Thanks for taking your time and effort to share this with us. Keep us updated.
Tally Course in Chennai
Tally Classes in Chennai
JavaScript Training in Chennai
JavaScript Course in Chennai
C C++ Training in Chennai
C Training in Chennai
Tally Course in Anna Nagar
Tally Course in T Nagar
Having an assignment due tomorrow and understand you can’t do it yourself? But you’re afraid of delegating your paper to some scam services as well? Why not check https://scamfighter.net/review/unemployedprofessors.com on Scamfighter.net
There are so many types of essays; it can be hard to know where to start. History papers aren’t just limited to history classes. These tasks can be assigned to examine any important historical event or a person. While they’re more common in history classes, you can find this type of assignment in sociology or political science course syllabus, or just get a history essay task for your scholarship.
What is a political essay? A political is just as the name suggests an essay based on politics or a political situation. Completing a political essay is impossible without the proper research to fully understand your subject. First, you should study the primary texts, to analyze its contents. You may take advantage of using reliable Internet sources, with available government reports and political parties' news. Scan through reputable newspapers and magazines to compile relevant data for your political essay. Find more political essay at http://writing-a-thesis.net/
Our non plagiarized custom term papers are reputable and known for offering high quality custom term papers. We normally write academic papers in all disciplines of study including those seeking for write my nursing paper services.
We are prepared to deliver reliable and trusted Custom Research Paper Writing Services in all the outlined levels of study due to the many experts that we have in our company.Our Affordable Writing Services are affordable and cheap as well. Students have very limited cash flows, and their budgets are usually constrained.
Is myassignmenthelp fake? Find out the complete truth behind the services MyAssignmentHelp provides.
We are the best writing company providing Essay Writer Servicesof the highest quality. We guarantee our customers of nothing but the highest quality document. Our Custom Term Paper Writing Services are well referenced, formatted and edited to ensure that the article is rid of unnecessary details.
A nice post shared.
tree trimmers loxahatchee
Nice post.
tile resurfacing minneapolis
Amaizng.
emergency restoration services fort lauderdale
Great post.
bathroom remodelers clearfield ut
Nice post.
bathroom remodeling clearfield county
A nice post shared.
concrete driveway contractors fort pierce
I really appreciate such a post.
kitchen remodel contractor ogden ut
Good thoughts and well wishes to you and your family. Stay strong!
kitchen remodel contractor fort lauderdale fl
It is understood that you do not have adequate time to write. Buy Custom College Papers and submit the Pre Written Research Papers. Make a decision to order Term Paper Writing Help today.
Worked like charm. Thank you.
express hotel lahore
interesting and attractive post.
free airdrops
Remarkable post.
finecoin
great post.
123movies
You have a good point here!I totally agree with what you have said!!Thanks.
airdrop crypto
Very nice!!! This is really good blog information thanks for sharing.
123 movie
Research Papers Writing Services should strive to ensure that all essays meets the pukka standards of the examining bodies. Consider hiring quality but also Qualified Research Paper Writers which are advantageous in terms of ensuring you get only top-quality grades on your Online Research Paper Writing Service.
Are you a student and searching for Write My Research Paper Online Services? Do you wish to acquire high-quality services from Legitimate Custom Research Paper Services? As Custom Research Writing Services can always bring a headache to scholars.
תמשיכו בפרסום פוסטים מעניינים כמו זה. תודה.
gabaygroup.com
very great content share.
שערים לבית מאלומיניום
Very Great Article.
סילברגייט
I have read your blog its very attractive and impressive. I like it your blog.
Final Year Projects for CSE in Dot Net
.Net Training in Chennai
Final Year Project Centers in Chennai
Dot Net Training in Chennai
בדיוק מה שחיפשתי. תודה רבה.
טבעת יהלום
כל מילה. תודה על השיתוף, מחכה לעוד פוסטים בנושא
מגשי אירוח טבעוניים
פוסט מעניין, משתף עם העוקבים שלי. תודה
פינות אוכל מעוצבות
תודה על השיתוף. מחכה לכתבות חדשות.
טיפולים קוסמטיים
פוסט נחמד. חייב לשתף עם העוקבים שלי.
שולחן פינת אוכל
great work.
רמקולים שקועים
תודה על השיתוף. מחכה לכתבות חדשות.
הפקת אירועים לחברות
מעולה. תודה על הכתיבה היצירתית.
מגדל למידה
מזל שנתקלתי בכתבה הזאת. בדיוק בזמן
ברוקרים
thank you for sharing.
קידום עסקים באינטרנט
Excellent information Providing by your Article. Thanks.
playboy bunny necklace silver
סופסוף מישהו שתואם לדעותיי בנושא. תודה.
בלוק תמונה
תמשיכו בפרסום פוסטים מעניינים כמו זה. תודה.
אלסק מערכות אבטחה
כתיבה מעולה, אהבתי. אשתף עם העוקבים שלי.
ניהול מוניטין ברשת
The application of GM crops has raised various social issues not only locally but internationally as well. Food choices are very much influenced by a large number of factors, including social and cultural factor. Avail Assignment Help on Modified GM Crops by expert writers based in Australia.
You write this post very carefully I think, which is easily understandable to me. Not only this, but another post is also good. As a newbie, this info is really helpful for me. Thanks to you.
Tally ERP 9 Training
tally classes
Tally Training institute in Chennai
Tally course in Chennai
This content of information has
helped me a lot. It is very well explained and easy to understand.
seo training classes
seo training course
seo training institute in chennai
seo training institutes
seo courses in chennai
seo institutes in chennai
seo classes in chennai
seo training center in chennai
نقل عفش من الرياض الى جدة نقل عفش من الرياض الى مكة
Wow...! Nice post
global asset management seoul
תודה על השיתוף. מחכה לכתבות חדשות.
מומחה קידום אתרים בגוגל
כל מילה. תודה על השיתוף, מחכה לעוד פוסטים בנושא.
מיטת מעבר
מזל שנתקלתי בכתבה הזאת. בדיוק בזמן
גיוס כסף לסטארט אפ
פוסט נחמד. חייב לשתף עם העוקבים שלי.
חברת פיתוח תוכנה
I really enjoyed very much with this article here.
global asset management seoul
I appreciate you for this blog.
global asset management
Online logistics management writing services are very difficult to complete and many students are always searching for Logistics Writing Services Online to help them complete their logistics coursework writing services and logistic research paper services.
פוסט מעניין, משתף עם העוקבים שלי. תודה.
https://canvi.co.il
great post.
מצלמה לבית
Good job
אינטרקום לדלת כניסה
great.
global asset management
Good job
Garage door repair Vaughan
thanks for sharing.
Global asset management Seoul
Hey Loved the post! Great article and congrats on Reaching the To 50! I will be back to visit often
this info is really helpful for me.
stratford management Tokyo
Bastion Balance Seoul
Bastion Balance Korea
Well written Blog
Hormone replacement Las Vegas
Spot on with this article, I really think this website needs more attention. I'll probably be back to read more, thanks for the info.
Bastion Balance Korea
Great article
garage door repair
Excellent Blog.
garage door repair
Help full post, lots of information
gazetted officer
z or r twice
what is isp
space complexity
ng-focus
unexpected token o in json at position 1
do a barrel roll 20 times
cannot set headers after they are sent to the client
how to hack any instagram account 100% working
blink html google trick
אני לא מסכים עם כל מה שכתוב, אבל מאמר מעניין מאוד
בניית בריכה ביתית
This is a nice article you shared great information.
overhead door repair edmonton
Amazing Article, Really useful information to all So, I hope you will share more information to be check and share here.
Jupyter Notebook
Jupyter Notebook Online
Jupyter Notebook Install
Automation Anywhere Tutorial
Rpa automation anywhere tutorial pdf
Automation anywhere Tutorial for beginners
Kivy Python
Kivy Tutorial
Kivy for Python
Kivy Installation on Windows
your site layout is very good
Garage Door Repair Chestermere
Interesting Blog
garage door repair pittsburgh
אם כי אני לא מסכים עם כל מה שנכתב, מאמר מעניין
פולקסווגן קראוול
מעניין מאוד, למרות שלא הכל מדויק לדעתי
כתרי זירקוניה
שירות מצוין. ממליץ בחום.
כלב קטן
informative content
garage door repair etobicoke on
Useful info shared.
broken torsion spring repair ottawa
Valuable knowledge
Garage Door Track Adjustment
Excellent info
garage door repair St Albert
You have got some great posts in your blog. Keep up with the good work.
pittsburgh garage door repair
keep it up
fixitmag.com
You have got some great posts in your blog. Keep up with the good work.
appliance repair etobicoke
Thanks for posting useful information.
Kald Gart Garage Door Repair
Good information and great post. I like the website, and am sure to keep returning.
garage door repair oakridge
I really appreciate such a post.
เว็บพนัน UFABET
แทงบอล
Amazing and attractive content
แทงบอลออนไลน์
I wanted to thank you for this great read. Your blog is one of the finest blog . Thanks for posting this informative article.
Garage Door Repair Doctors
ความหมายศิลปะ
Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog?
Los Angeles Garage Door Repair
Are you a traveller and would like to visit Morocco? Then, your trip is sure to be hitch-free when you travel through a reliable Marrakech day excursion .. marrakech to ouzod day trip
Variety of best things to do in Morocco 5 days desert trips from marrakech . travel morocco Rel morocco travel from spain.. morocco with a. marrakech to ouarzazate day trip
Variety of best things to do and see is adverse when you have a trip to Morocco, with a Agency in
Great blog, keeping me from working. All the Best
garage door repair east houston tx
מרתק כמה שלא הבנתי כלום עד שקראתי את המאמר הנפלא הזה
נכס מסחרי מניב למכירה
חייב להחמיא על הכתיבה. מאמר מצוין.
אינטרקום סקיוריטי
Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog?
silvergaragedoors.ca
Great blog, keeping me from working. All the Best
garage door repair northwest edmonton
Valuable information! Looking forward to seeing your notes posted.
Garage Door Installation Pittsburgh
I wanted to thank you for this great blog! I really enjoying every little bit of it and I have you bookmarked to check out new stuff you post.
garage door repair Calgary
There are certainly a lot of details like that to take into consideration.
garage door repair company
Whatsapp Number Call us Now! 01537587949
please visit us: Seo service
sex video: phone home buttons repair Canton
pone video usa: Mobile Phone Repair
pone video usa: Courier Companies In USA
This discussion unexpectedly takes my attention to join inside. Well, after I read all of them, it gives me new idea for my blog. thanks
garage door repair articles
I am really very agree with your qualities it is very helpful for look like home. Thanks so much for info and keep it up.
garage door repair Cambridge
Nicely presented information in this post, I prefer to read this kind of stuff. The quality of content is fine and the conclusion is good. Thanks for the post.
garage door repair
חייב להחמיא על הכתיבה. מאמר מצוין.
לבנדר שירותי ניקיון
Very informative content
News For Finance Magazine
You have a great blog - I would think your readership is very high?
אטרקציות לבת מצווה
This amazing post impressed me
financial news magazine
מאמר מצוין נהניתי מכל רגע של קריאה
אטרקציות לבר מצווה
Nice service there are just few who are providing this service great job.
duct cleaning pittsburgh
You have a very good site, well constructed and very interesting i have bookmarked you, hopefully you keep posting new stuff, many thanks
air duct cleaning pittsburgh
This discussion unexpectedly takes my attention to join inside. Well, after I read all of them, it gives me new idea for my blog. thanks
Garage Door Doctor
Nice content
pittoverheadgaragedoorrepair.com
This amazing post impressed me
garage door repair burlington
This amazing post impressed me
cleveland plumbing repair
Thank you for sharing such a good and useful information.
essay writing service reddit
I was exactly searching for. Thanks for such a post and please keep it up.
garage door slams shut
This is a wonderful article, Given so much info in it, These type of articles keeps the user's interest in the website.
duct cleaning pittsburgh
Post a comment