asp.net-web-api-helppages

asp.net mvc web api help page not populating for given route

柔情痞子 提交于 2020-01-26 01:41:37
问题 I am having difficulties having the help page populate for a web api controller. The only method in the controller is the following: public HttpResponseMessage Get(string p1,string p2= "blend", string p3 = "blend") The method appears reflected in the help page with the signature: GET api/mycontroller?p1={p1}&p2={p2}&p3={p3} However none of my comments flow to the help page. For other simple controller Get(string id) the help page works ok. I tried adding the following on the WebApiConfig.cs

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

梦想的初衷 提交于 2020-01-12 06:51:09
问题 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

Resource Description on Web API Help page is showing “None.”

风格不统一 提交于 2020-01-02 05:15:13
问题 I'm having trouble figuring out how to get the Help page in my Web Api to show anything for Resource Description other than None. It has IHttpActionResult linked and then "None." after that. I got my samples working by adding config.SetActualResponseType(typeof(ComplexType), "Controller", "Action"); to HelpPageConfig.cs. My controller looks like this: /// <summary> /// My description /// </summary> [Route("MyRoute")] public IHttpActionResult Get() { try { //throw new Exception("TEST"); return

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

Deadly 提交于 2020-01-01 11:57:08
问题 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

Web Api - Auto generating request samples using ApiExplorer

痞子三分冷 提交于 2019-12-23 11:59:05
问题 Is there a way to make ApiExplorer auto generate request samples? I tried using: config.SetActualResponseType(typeof(SomeType), "ControllerName", "Post"); in HelpPageConfig.cs, but 2 problems came up: it requires me to define specific types for specific controllers and actions and I'm looking for something more generic which will not require adding\changing code if a new controller\type was added. I can only use one type per controller\action, so I can't generate a full request sample for an

Web API Help page showing two versions of every method

你离开我真会死。 提交于 2019-12-22 10:44:11
问题 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. 回答1: If you're simply looking to hide this route in the Help

Web API routing and a Web API Help Page: how to avoid repeated entries

空扰寡人 提交于 2019-12-22 08:57:53
问题 I am getting repeat entries rendered in my Web API Help Page with different parents, such as these, that refer to the same method: GET api/{apiVersion}/v1/Products - Gets all products ... GET api/v1/Products - Gets all products ... I have a Web API page with some routing like this: config.Routes.MapHttpRoute ( name: "DefaultVersionApi", routeTemplate: "api/{apiVersion}/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); config.Routes.MapHttpRoute ( name: "DefaultApi",

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

假如想象 提交于 2019-12-21 05:24:06
问题 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

Can't get ASP.NET Web API 2 Help pages working when using Owin

你离开我真会死。 提交于 2019-12-17 22:20:02
问题 I've installed the correct package for Web Api 2 Install-Package Microsoft.AspNet.WebApi.HelpPage -Pre But the help area is not being mapped and is returning 404 (Web Api working fine). I'm using Microsoft.Owin.Host.SystemWeb as the host. Below is my Startup code. public class Startup { public void Configuration(IAppBuilder app) { //Required for MVC areas new HttpConfiguration() doesn't work with MVC var config = GlobalConfiguration.Configuration; AreaRegistration.RegisterAllAreas();

Web API help page duplicating Action for all areas

安稳与你 提交于 2019-12-11 02:06:11
问题 I'm working with Web API 2, and it seems to pull up my existing API calls already, except it's duplicating all the calls for each area that i have. For example, say i have 3 areas, and in one of those i have an API call that looks like: public IList<string> GetStringList(string id) { //do work here... return new List<string>{"a","b","c"}; } if i have 3 areas, then the web api help page will show: GET area1/api/MyAPIController/GetStringList/{id} GET area2/api/MyAPIController/GetStringList/{id}