asp.net-web-api-helppages

Web API Help Pages - User-specific response type

拟墨画扇 提交于 2019-12-10 21:49:11
问题 I'm developing an API that outputs a different response based on the user, and I'm currently using the ResponseType attribute to describe the type of response that's returned, but this only allows me to specify one type of response, which will differ between users. Is there any way I can customise the help pages to display the response type that the user will get? 回答1: HelpPage does not support these dynamic response types and relies on available static information. HelpPage doesn't support

How to add Multipart Form Data parameter on WebAPI help page

老子叫甜甜 提交于 2019-12-10 14:09:15
问题 Please help me to add a multipart/form data parameter on api help page. I'm using Microsoft.AspNet.WebApi.HelpPage.VB 5.2.2 . I want to add CustomerName, fdStreet1, fdStreet2 parameter information on to the api help page. How can I do this? Here's what I have so far. <HttpPost> _ <ResponseType(GetType(TestModel))> _ <Route("TestAdd")> _ Public Function TestAdd() As IHttpActionResult Dim ServerUploadFolder = HttpContext.Current.Server.MapPath("~/Uploaded/") If Not Request.Content

Are XML documentation tags not being handled by Web API 2 help pages?

时光怂恿深爱的人放手 提交于 2019-12-09 11:52:15
问题 I'm trying to use <see cref=""> tags in my XML documentation tags for my API, but they are coming up blank in the Help pages. So, for a Description I'd like it to say: "Gets or sets the value for the associated Item ." Where Item is a link to another object in the API. Instead, I'm getting: "Gets or sets the value for the associated ." So the <see cref=""> tag is being ignored. I've even tried using examples from here just in case my declaration was wrong, but that didn't work either. Has

Web API Help page showing two versions of every method

核能气质少年 提交于 2019-12-06 01:30:21
How can I avoid the Help page showing both versions of my method? As you can see, I've set up a custom route for /api/property/search/{finnId} , but I don't want the one using query parameters to show up in the Help page. Any way to get around this? I'm using the built in Help page from the ASP.NET Fall 2012 BUILD preview. Btw, don't worry about the fact that it says POST , I've since switched it to GET , but I get the same results. If you're simply looking to hide this route in the Help page and not actually disable it in the app, you could always tweak the logic in the display template. You

How to make ASP.NET WEB API HELP PAGES Xml Documentation Comments to have new line

烈酒焚心 提交于 2019-12-04 07:31:31
I have a rest api developed using ASP.NET WEB API. I used help pages nuget package in order to create documentation. One problem I encountered is the following. For my model objects, I have xml documentation comments and they become descriptions on the help pages for each member of the model. I want certain part of the description to be on a new line, but everything in the comment comes as one paragraph. I tried to add <br/> in the comments, but didn't help. Does anyone know how to achieve this? Lasse Christiansen A similar question has been asked here: Web Api Help Page- don't escape html in

ApiExplorer does not recognize route attributes with custom type

喜欢而已 提交于 2019-12-04 05:05:30
问题 I have a project where I want to use route attributes with a custom type. The following code where I have the custom type as a query parameter works fine and the help page displays the custom type. // GET api/values?5,6 [Route("api/values")] public string Get(IntegerListParameter ids) { return "value"; } WebApi.HelpPage gives the following documentation Help:Page If I change the code to use route attributes, the result is that I get an empty help page. // GET api/values/5,6 [Route("api/values

WebAPI Help Page - Documentation for return or parameter model/class properties

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 17:02:18
I am using Web API Help Page with Web API 2 (5.0) - both the latest Nuget packages. I would like the help documentation to show the comments of the properties on classes that are parameters or returned in the body of the HttpResponseMessage. For example, I have a controller method like this: public HttpResponseMessage Post([FromBody] MyClassType1 myClass) { // Business logic removed for clarity return Request.CreateResponse(HttpStatusCode.OK, new MyClassType2()); } I would like the XML comments that I have on MyClassType1 and MyClassType2 to be displayed on the help page for the above post

“Access is denied” on build server when deploying Web API project with XML documentation

不问归期 提交于 2019-12-03 10:44:30
In order to generate XML documentation using Web API Help Pages for my Web API project, I had to check the "XML documentation file" option under the "Builds" section of my project's properties. This correctly generates the documentation when I build locally. However, when I check in, I get the following error on the build server: CSC: Error generating XML documentation file 'c:\Builds\3...\Sources\CurrentVersion...\ProjectName\App_Data\XmlDocument.xml' ('Access is denied. ') I'm not sure why this happens, since it creates a new directory for each build anyway. I googled this issue and searched

ASP Web API Help pages - Links to other pages

谁说胖子不能爱 提交于 2019-12-02 12:19:48
问题 I am using Web API help pages and I would like to be able to include links to other methods. I have seen from Are XML documentation tags not being handled by Web API 2 help pages? that using <see cref='...'> isn't supported. Are there any better options than writing my own <a href='...'> links in the documentation, and using the method described in Web Api Help Page- don't escape html in xml documentation to get these <a> tags output to the help? It seems very brittle to any future changes.

ASP Web API Help pages - Links to other pages

好久不见. 提交于 2019-12-02 07:33:25
I am using Web API help pages and I would like to be able to include links to other methods. I have seen from Are XML documentation tags not being handled by Web API 2 help pages? that using <see cref='...'> isn't supported. Are there any better options than writing my own <a href='...'> links in the documentation, and using the method described in Web Api Help Page- don't escape html in xml documentation to get these <a> tags output to the help? It seems very brittle to any future changes. The only alternative I could think of would be to force the API explorer to run twice - once to cache